Question:
In powershell, how do I check if a program is running by using the full path of the program executable? Or do I need to parse the path to get the process name?
Thanks.
EDIT:
I need to know if the executable “C:\My Temporary Programs\Test 1.exe” is running.
Answer:
Try this:
1 2 |
get-process | ?{$_.path -eq $path} |
So you can do something like:
1 2 3 4 |
if(get-process | ?{$_.path -eq "C:\My Temporary Programs\Test 1.exe"}){ #exe is running. Do what you want } |