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?