Check Whether a Program is Running

by Aug 25, 2011

If you'd like to find out whether an instance of WinWord (or any other program) is currently running, you can try this:

(Get-Process winword -ea 0) -ne $null

This line will returns $true if at least one instance is running. Note that this will also report running instances in other sessions. So, if multiple users are logged on or you are using a terminal server, you may want to check for process ownership.

Twitter This Tip!
ReTweet this Tip!