taskkill more than one program uses the same name
Posted: 21 Jul 2011 07:55
I am working on a batch file that contains a line similar to:
TASKKILL /F /T /IM program.exe
This works fine and kills the program.exe that I want it to kill, but it also kills other processes running using that same name.
C:\Program Files\Program1\program.exe
C:\Program Files\Common Files\program.exe
I only wanted "C:\Program Files\Program1\program.exe" to be killed, so I tried to add that whole path to the command:
TASKKILL /F /T /IM "C:\Program Files\Program1\program.exe"
but that did not work.
Finally, I tried:
TASKKILL /F /T /IM program.exe
@start "" "C:\Program Files\Common Files\program.exe"
but I was curious if there was a better way to do this that will stop the program that I want to stop, but not stop the other program that I want to stay running, even though the names are the same. Thanks.
TASKKILL /F /T /IM program.exe
This works fine and kills the program.exe that I want it to kill, but it also kills other processes running using that same name.
C:\Program Files\Program1\program.exe
C:\Program Files\Common Files\program.exe
I only wanted "C:\Program Files\Program1\program.exe" to be killed, so I tried to add that whole path to the command:
TASKKILL /F /T /IM "C:\Program Files\Program1\program.exe"
but that did not work.
Finally, I tried:
TASKKILL /F /T /IM program.exe
@start "" "C:\Program Files\Common Files\program.exe"
but I was curious if there was a better way to do this that will stop the program that I want to stop, but not stop the other program that I want to stay running, even though the names are the same. Thanks.