Repair Corrupt System Files in Windows 10

Background:

The initial file corruption seems to have happened after an automated reboot by Windows Update while some disc scanning operations were still ongoing. The sudden reboot probably damaged some system files and resulted in Windows Explorer crashing immediately after opening. Windows Explorer would also crash immediate when your right click on any drives as well as on the recycle bin.

Solution:

The repair process was fairly straightforward using SFC and DISM. However, SFC /SCANNOW was not able to perform the repair at first and gave the Windows Resource Protection could not perform the requested operation. message. This usually points to corrupted files that would require a disk scan. CHKDSK C: /R was issued and system drive was checked and repaired upon next reboot.

After CHKDSK finished and all disk errors were repaired, SFC /SCANNOW was still not successful due to some files’ hash mismatch (logs can be checked under WINDIR\LOGS\CBS\CBS.log), so I resorted to using DISM /Online /Cleanup-Image /RestoreHealth . However, after issuing this command, it was still unable to perform the repair with another error message The source files could not be found. This indicates that you’ll need a healthy Windows installation ISO file to be the source file, usually you can use the Windows Media Creation Tool to create an installation media, but when I performed the repair in Safe Mode , the Media Creation Tool was failing with the error code 0x8007043C – 0x90018 every time it ran. As a workaround, I used this link to manually download a Windows 10 ISO file. When the ISO file is ready, extract the content into a folder and check under the “sources” directory to see whether you have the file install.wim or install.esd, as the following commands will be slight different.

# Assume the extracted installation files are under E:\Win10\sources\install.wim .

DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:E:\Win10\sources\install.wim:6 /LimitAccess

# Use this command instead if your image contains install.esd file.

DISM /Online /Cleanup-Image /RestoreHealth /Source:ESD:E:\Win10\sources\install.ESD:6 /LimitAccess

# This command eventually did the trick for me and successfully finished the repair. If you need to find out the index number of the right Windows version to use (the index number might be different if you're using a different installation image), the following command can help identify, and then just replace the number 6 in the commands above with the right Windows version that fits your needs.

DISM /get-wiminfo /wimfile:E:\Win10\sources\install.wim

For more comprehensive instructions, refer to this article.