If you encounter any system errors that may occur due to issues with system files or Dynamic Link Libraries (DLLs), you can run SFC to resolve the issues. However, there are more than one ways to run SFC with different options. And you may need to run this utility when you can’t normally boot to your OS. In this article, we have provided detailed steps for all these scenarios.
How Does SFC Repair Corrupt System Files
Before Windows Vista, System File Checker would use the cached copy of the system files in a compressed folder inside the %SystemRoot%\System32\dllcache directory for scanning and repairing corrupt system files. Now, however, Microsoft integrated SFC inside the Windows Resource Protection (WRP) feature. This feature prevents outside sources from replacing the crucial built-in system files and registry data. Whenever you run SFC, Windows Resource Protection performs the following operations to scan and repair the protected files:
First, it checks whether the protected system files, especially DLL files, are in the correct location or not. It does so by comparing the files with the corresponding registry entries, usually the COMPONENTS registry hive.If it finds inconsistencies, it checks system files against the files inside %WinDir%\WinSxS or %WinDir%\WinSxS\Backup folders (Windows Component Store).Most of the Windows files, especially inside System32, are hard-linked to the components inside the WinSxS folder. So, only the files inside the folder actually exist and the usual system files simply link to these components. WRP checks any broken hard links and repairs them.It does not check all the links but gets information from the registry on which links need examination.If it still can’t repair corrupt files, it accesses the file store on Microsoft’s website (you need to be connected to the internet for this) to look for and replace the files and re-creates the hard links.If you run SFC using a different Windows folder on the PC (if you have a multi-boot system), WRP also looks upon the other OS for replacing the system files.If WRP fails to resolve the issue, it gives the “Windows Resource Protection found corrupt files but was unable to fix some of them” error message.In some scenarios, the WRP becomes unable to scan the files or can’t run at all. In such cases, running SFC gives the “Windows Resource Protection Could Not Perform the Requested Operation” error message.
It also creates a log file, %windir%\Logs\CBS\CBS.log, which includes the details of the process. You can check the log by entering the following command on Prompt to create a readable .txt file from the log and then opening it:
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt"If you get a “The system cannot find the path specified” error, you may have enabled syncing of the Desktop folder on OneDrive. So, you need to replace “%userprofile%\Desktop\sfcdetails.txt” with “%userprofile%\OneDrive\Desktop\sfcdetails.txt” on the above command.
How to Run System File Checker to Repair Corrupt Files
There are mainly three scenarios where you need to run the System File Checker,
Scan all system files and repair the corrupted ones.Scan and repair a specific system file.Scan and repair system files when you get stuck in the startup or can’t log in to an account.
SFC contains many parameters to aid in this process, which are: Now, let’s move on to the detailed steps for each task.
Running System File Checker on All System Files
The most common use of the System File Checker is to scan and repair all the protected system files at once. Here’s how you can do so: This command scans and repairs all protected system files. The reason to run sfc /verifyonly even though sfc /scannow also scans the files, is because the latter takes longer. So, unless there’s a need to you don’t need to run it. We recommend running the Deployment Image Servicing and Management (DISM) tool first before SFC. This is because this utility also repairs the files on the WinSxS folder if there are any issues. The command is dism /online /cleanup-image /restorehealth
Running System File Checker on a Particular System File
You can also run SFC for a particular file. However, it must be a protected system file, otherwise, SFC will fail. Here are the steps to scan and repair a particular system file: Like with the previous case, you can run the DISM tool beforehand to increase the success of the SFC command.
Running System File Checker in Safe Mode
If you can’t log in to your account due to system issues, you can try running SFC in safe mode. Here’s how you can do so:
Running Offline System File Checker
If you can’t even boot in safe mode, the only option you have, if you get stuck in startup, is to run the offline SFC scan. You need need to access the Advanced Startup to do so. While you can use your own Operating System to access this environment, we recommend using an installation or recovery disk to increase your success. Here are the necessary steps to run the offline SFC: