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.

Close outlook by Command step

I am trying to close Outlook on machines before installing a program. This is the command I am using in the Command step "taskkill /IM outlook.exe".

This command works on my computers command line, does anyone know why it doesn't work the same for PDQ? I've actually had several issues using the Command step like a normal command line.

0

Comments

2 comments
Date Votes
  • Sure do! It's probably because of user context. The command step is being executed as whatever your Deployment User is. That's typically rather a local administrator account, or some type of service account.

    So when your command step runs, it can't find outlook.exe because that Deploy user doesn't have it open, so it fails. 

    Now, you do have the option to run the step as "Logged On User", which is what you want to do. That way that command will run in the currently logged on user's context, and find and close outlook (if it is opened).

     

    That said, I think a Powershell step with some better logic in it would help you out immensely as well.

    Check this out:

     

    Try{

     If ((Get-Process OUTLOOK)){

         Stop-Process OUTLOOK

    }

    }

    Catch {

    Write-Output "Process was not running, safe to continue"

    }

     

    0
  • The command is just fine, it only needs /f to force the exit.

    So "taskkill /IM outlook.exe /f" should be just fine.

    1