1 Reply Latest reply on Dec 23, 2010 2:09 AM by Stocktrader

    Installing package only if Outlook is closed

    Rookie

      Is there a way to push a package to a workstation only if Outlook 2007 is closed?

        • 1. Re: Installing package only if Outlook is closed
          Employee

          Hello,

           

           

           

          to achive this you need to create a script that uses WMI or other technologies to detect if the process is running and base the decision on the condition.

           

          This is one of the possible examples:

           

           

           @echo off 
           
          if tasklist /FI "IMAGENAME eq outlook.exe" /FI "STATUS eq running"| find /i "outlook.exe" && set PROCEXIST=YES 
           else 
          set %PROCEXIST%=NO 
           
          
          if /I "%PROCEXIST%"=="YES" goto :NOEXEC 
          if /I "%PROCEXIST%"=="NO" goto EXIT 
           
          :NOEXEC 
          REM   The process is running....so do not proceed
          exit
          :EXIT 
          REM Outlook.exe not running...
          REM put in this section the command to trigger the installation
           
           exit
          
          
          
          
          

           

          Kind regards,

          StockTrader