I am trying to kill chrome from bat file. Tried
TASKKILL /IM chrome.exe /F
but it doesnt close the chrome. What is the correct way to do that ?
I am trying to kill chrome from bat file. Tried
TASKKILL /IM chrome.exe /F
but it doesnt close the chrome. What is the correct way to do that ?
You'll want to use the same command, but with the /T argument, like so:
The /T argument kills the process and all of its child processes. Effectively, it should close all processes with the same process name that you provide in the argument list.
If you'd like to suppress errors/output, pipe the ouput to nul, like this:
Regardless of the method you use, you must run the batch file as an Administrator to kill the chrome.exe processes.
taskkill /F /IM chrome.exe /T
or
taskkill /F /IM chrome* /T
{Explanation:
taskkill (to kill the processes),
/F (forcefully terminate the process),
/IM (Image Name of the process to be terminated. '*' wildcard can be sure to specify all the tasks or image names)
/T (Terminate all child of the image or process) )
this code is working in my script well:
Not the answer you're looking for? Browse other questions tagged batch-file command-line cmd or ask your own question.
asked
viewed
35,114 times
active
10 months ago
Linked
Related
Hot Network Questions