4

After launching the sfc /scannow resource checker from a command prompt or a batch file, is there any way to cancel the process or does the process have to be left to complete?

In Windows XP, sfc /cancel would allow this. However it does not appear to be the case in Windows 7.

I have tried tasklist hoping to find the image name and then use taskkill to kill it, but I cannot identify the sfc /scannow process from the list.

Can anyone tell me which is the correct process to kill? Or is there another way to cancel the sfc /scannow?

EDIT:

To be clear: Ctrl+C only ends the command prompt readout but NOT the process. This can be seen as trying to run another sfc /scannow after Ctrl+C gets the response Another servicing or repair operation is currently running.

3

I think this might be a bad idea. Also I think your method of verifying it has stopped might be wrong.

On my computer I ran sfc /scannow. Once it had started I opened another cmd prompt and ran taskkill /IM sfc.exe /T /F. This killed the sfce process and it's child process. I verified this by watching the performance tab of task manager (I am on Windows 10) and seeing that disk activity dropped back down to 0.

I tried running `sfc /scannow' again and it said another operation is running but I suspect that is because sfc marked somewhere that it was starting and never got to unmark that because I terminated it forcefully. Hopefully that will resolve after a reboot.

In summary taskkill /IM sfc.exe /T /F will kill running processes named sfc.exe (/IM sfc.exe), kill child processes spawned by that sfc.exe (/T) and do so forcefully (/f).

  • "because sfc marked somewhere " found this solution "dism.exe /image:C:\ /cleanup-image /revertpendingactions"....superuser.com/a/608543/40928 – Moab May 5 '16 at 16:56
  • @Moab Nice, but DISM.exe will not access image:C:\ while windows is running. Potentially we could use the dism.exe /online command instead, but /cleanup-image /revertpendingactions gets "error 50 - this operation is only supported against an offline image" and does not cancel the sfc mark. – Matthew May 5 '16 at 18:48
0

If you have the "another servicing or repair operation is currently running" message

2 solutions :

  • Reboot

  • Restart TrustedInstaller service :

    Get-Service TrustedInstaller | Restart-Service
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.