0

A batch file is used to close browsers when backing up the user's profile(s).

Firefox closes all processes on the taskkill command but Chrome doesn't. In this example, there are nine tasks even though Chrome only had two tabs open. There is one extension (Ublock Origins).

    tasklist /fi "imagename eq chrome.exe"

Image Name                     PID Session Name        Session#    Mem Usage  
========================= ======== ================ =========== ============  
chrome.exe                    7484 Console                    1     78,400 K  
chrome.exe                    8064 Console                    1      3,840 K  
chrome.exe                    2604 Console                    1      4,352 K  
chrome.exe                    7956 Console                    1     49,980 K  
chrome.exe                    7588 Console                    1     20,904 K  
chrome.exe                    2136 Console                    1     15,812 K  
chrome.exe                    6452 Console                    1     53,228 K  
chrome.exe                    6216 Console                    1     32,484 K  
chrome.exe                    6220 Console                    1     38,720 K  

    taskkill /im chrome.exe

SUCCESS: Sent termination signal to the process "chrome.exe" with PID 7484.  
SUCCESS: Sent termination signal to the process "chrome.exe" with PID 8064.  
SUCCESS: Sent termination signal to the process "chrome.exe" with PID 2604.  
SUCCESS: Sent termination signal to the process "chrome.exe" with PID 7956.  
ERROR: The process "chrome.exe" with PID 7588 could not be terminated.  
Reason: This process can only be terminated forcefully (with /F option).  
ERROR: The process "chrome.exe" with PID 2136 could not be terminated.  
Reason: This process can only be terminated forcefully (with /F option).  
ERROR: The process "chrome.exe" with PID 6452 could not be terminated.  
Reason: This process can only be terminated forcefully (with /F option).  
ERROR: The process "chrome.exe" with PID 6216 could not be terminated.  
Reason: This process can only be terminated forcefully (with /F option).  
ERROR: The process "chrome.exe" with PID 6220 could not be terminated.  
Reason: This process can only be terminated forcefully (with /F option).  

There should be nothing running after Chrome closes because "Continue running background apps when Chrome is closed" in Menu/Settings/Advanced/System is unchecked.

Task Manager shows no chrome processes running, even though five of them did not terminate.

The /F parameter will terminate all processes but it has the ugly side effect that when Chrome is re-opened you are met with 'Chrome did not shut down successfully' and tabs have to be restored.

Can anyone shed any light on what the other five processes might be?

Is there any way to find out if they continue to run when /F is not used?

2 Answers 2

1

This error message can be ignored - Chrome is truly terminated without the need for using /f.

If you use Process Explorer in tree mode (using Process Explorer), you will see a display similar to:

enter image description here

This means that process 11472 is the true chrome.exe and the others are only child processes, meaning that terminating this process will also terminate the others.

Once process 11472 is killed, the others follow. You would get a racing condition as regarding the child processes, a race between Windows and taskkill. The reason that taskkill cannot kill these processes is just that they no longer exist.

Here is the proof:

enter image description here

0

Thanks for the explanation, a race condition makes sense. Turns out that Chrome has its own Task Manager, so have been able to partially answer what the Chrome tasks are.

tasklist /fi "imagename eq chrome.exe"

chrome.exe 7304 Console 1 87,368 K Browser
chrome.exe 6640 Console 1 3,880 K ?
chrome.exe 5236 Console 1 4,324 K ??
chrome.exe 6012 Console 1 64,120 K GPU Process
chrome.exe 3900 Console 1 20,296 K Utility: Network Service
chrome.exe 2972 Console 1 17,032 K ???
chrome.exe 7384 Console 1 42,396 K Extension
chrome.exe 7128 Console 1 50,080 K Tab
chrome.exe 5928 Console 1 29,856 K Tab

Menu/More Tools/Task Manager

This identified six of the nine processes.

taskkill /im chrome.exe

SUCCESS: Sent termination signal to the process "chrome.exe" with PID 7304. Browser
SUCCESS: Sent termination signal to the process "chrome.exe" with PID 6640. ?
SUCCESS: Sent termination signal to the process "chrome.exe" with PID 5236. ??
SUCCESS: Sent termination signal to the process "chrome.exe" with PID 6012. GPU Process
ERROR: The process "chrome.exe" with PID 3900 could not be terminated. Utility: Network Service
Reason: This process can only be terminated forcefully (with /F option).
ERROR: The process "chrome.exe" with PID 2972 could not be terminated. ???
Reason: This process can only be terminated forcefully (with /F option).
ERROR: The process "chrome.exe" with PID 7384 could not be terminated. Extension
Reason: This process can only be terminated forcefully (with /F option).
ERROR: The process "chrome.exe" with PID 7128 could not be terminated. Tab
Reason: This process can only be terminated forcefully (with /F option).
ERROR: The process "chrome.exe" with PID 5928 could not be terminated. Tab
Reason: This process can only be terminated forcefully (with /F option).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .