Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Check to see if a program is running

Is there a way to see if a program is running and if it is cancel the install? I am referring to flash player. The last deployment that I did for the newest flash player, some users were having an issue using flash in IE and I had to uninstall and reinstall to resolve the issue. I think that they may have been on youtube while the install occurred, so I would like to have a step added in the install that if they are using flash then the deployment will not occur. I did see the check to see if program open before deploying link and that is for a much older version and the interface is different. Thank you for your help.

0

Comments

3 comments
Date Votes
  • If you know the details of what you're looking for, here's what I'm using:

     

    Command step configured to "Stop Deployment with Error":

    tasklist /FI "IMAGENAME eq notepad.exe" | find /I /N "notepad.exe"

    Success Codes: 1

    If notepad.exe is running, it will fail, and stop the deployment.  If it's not, it will continue to the next step.

    And you can search for more than that: https://ss64.com/nt/tasklist.html

    Hopefully that helps.

     

     

    1
  • There isn't a way to check for a running program from within PDQ, however there are a few other options that may also work.

    1. Write a .bat script and run it as the first step. It would check for a running process or service and then exits with a exit code 1 so that following steps will not run.

    2. Do a check if a user is logged on and if so end the install. This can be done in the Conditions tab of an install step. (Logged On State).

    3. Just include a step that will kill any browser before running Flash install. Because it would kill any browser it would be recommended to schedule the install for after hours so that you don't inconvenience users.

    0
  • here is what I'm trying:  (This is a powershell step prior to any deployment steps)

    stop-process -ProcessName "t" -whatif 

    Success code is -37104

     

    If powershell doesn't find the process named "t" it throws an error and provides us exit code -37104, which we define in the step as success.  If it does find it, it just runs the -whatif and provides us with exit code 0 -- which we omit from the success codes.  My issue is that if people are using the program and we kill the process, records will get locked in the database... 

    0