Close chrome from bat file

I am trying to kill chrome from a bat file. Tried

TASKKILL /IM chrome.exe /F

      

but it doesn't cover chrome. What is the correct way to do this?

+3


source to share


2 answers


You want to use the same command but with the / T argument, for example:

taskkill /F /IM chrome.exe /T

      

The / T argument kills the process and all of its children. In fact, it should close all processes with the same process name you provided in the argument list.



If you want to suppress errors / output, pipe the output down to nul, for example:

taskkill /F /IM chrome.exe /T > nul

      

Regardless of the method you use, you must run the batch file as administrator in order to kill chrome.exe processes.

+7


source


this code works in my script well:



taskkill /f /im chrome.exe /fi "username eq domain\user.name"

      

0


source







All Articles