Chrome – Removing or disabling Chrome’s Task Manager with a batch-file

google-chrometask-manager

I am trying to find a way to either disable or completely remove Chrome’s Task Manager.

My proposed solution involves using a batch-file running in the background to detect if the Chrome Task Manager is open, and shut down Chrome if it is. Unfortunately, I do not know batch programming and am low on time for this problem to be solved.

Here’s a couple of ideas I had for this:

  • This command detects how many instances of Chrome are running:

    tasklist /nh /fi "imagename eq chrome.exe" | find /i "chrome.exe" >nul && (wmic process where name="chrome.exe" | find "chrome.exe" /c

  • This command kills all Chrome processes:

    taskkill /im chrome.exe

This does not work because Chrome does not create a new process when the Task Manager is opened, though it does create a new window. (There is no change in the Processes tab of the Windows Task Manager, but there is one in the Tasks tab.)

I will settle for a program that shuts down Chrome if it detects two windows of it open, even partial solutions are welcome at this point.

Best Answer

This should get you some of the way there.

For detecting if Task Manager is open - use something like this:

tasklist /fi "WINDOWTITLE eq Task Manager - Google Chrome" /v | find "chrome.exe"

In a batch file you will probably need to escape the pipe character:

tasklist /fi "WINDOWTITLE eq Task Manager - Google Chrome" /v ^| find "chrome.exe"

Then use an %ERRORLEVEL% check to see if you it found it and kill them all:

if "%ERRORLEVEL%" == "1" TASKKILL /IM chrome.exe /F

I'll leave you to loop in batch (consider adding a sleep too).

Related Question