Close chrome from bat file

77,269

Solution 1

You'll want to use the same command, but with the /T argument, like so:

taskkill /F /IM chrome.exe /T

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:

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

Regardless of the method you use, you must run the batch file as an Administrator to kill the chrome.exe processes.

Solution 2

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) )

Solution 3

this code is working in my script well:

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

Solution 4

This works great for me:

taskkill /IM chrome.exe

Close Google Chrome but after when you reopen the software leaves the opened tabs just like last time.

Share:
77,269
user198989
Author by

user198989

Updated on July 31, 2022

Comments

  • user198989
    user198989 almost 2 years

    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 ?