Advertisements

How to repair files identified as corrupted by sfc /scannow

A frequently used tool to identify Windows issues is the System File Checker, or sfc. It’s usually run as such:

sfc /scannow

This will scan through your system files and tell you if any files are corrupt. But — is there an easy way to repair those corrupt files, other than doing a full re-install? Turns out, there is: Connecting to the Internet, and using dism, as shown below:

dism /online /cleanup-image /restorehealth

See below for a copy-paste log that I did on the system I’m currently using to write this post. SFC identified corrupt files, I ran dism, and then re-ran sfc.

C:\WINDOWS\system32>sfc /scannow

Beginning system scan. This process will take some time.

Beginning verification phase of system scan. 
Verification 100% complete.

Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log windir\Logs\CBS\CBS.log. For example C:\Windows\Logs\CBS\CBS.log. Note that logging is currently not supported in offline servicing scenarios.

C:\WINDOWS\system32>dism /online /cleanup-image /restorehealth

Deployment Image Servicing and Management tool 
Version: 6.3.9600.17031

Image Version: 6.3.9600.17031

[==========================100.0%==========================] 
The restore operation completed successfully. The component store corruption was repaired. 
The operation completed successfully.

C:\WINDOWS\system32>sfc /scannow

Beginning system scan.  This process will take some time.

Beginning verification phase of system scan.
Verification 100% complete.

Windows Resource Protection did not find any integrity violations.

Credits to this forum for having the original post of the fix.

Advertisements