Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Close chrome from bat file

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 ?

like image 314
user198989 Avatar asked Dec 10 '14 23:12

user198989


People also ask

How do I kill a chrome process?

Simple use "Utility -Environment" --> Kill process with "chrome" as input.

How do I close a .bat file?

EXIT /B at the end of the batch file will stop execution of a batch file. use EXIT /B < exitcodes > at the end of the batch file to return custom return codes. Environment variable %ERRORLEVEL% contains the latest errorlevel in the batch file, which is the latest error codes from the last command executed.

How do I close all instances of Chrome?

Click the “≡” button in the upper right corner of the Chrome browser window. Select the Exit button. This will close all tabs and windows and end the process.


2 Answers

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.

like image 97
Patricio Moreno Avatar answered Sep 28 '22 15:09

Patricio Moreno


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

like image 26
Ankit Gupta Avatar answered Sep 28 '22 15:09

Ankit Gupta