Windows system files are the backbone of your operating system, managing everything from core processes to user interface elements. Over time, these files can become corrupted due to sudden power loss, malware infections, failed software installations, or simple hardware errors like a failing hard drive. When you encounter persistent blue screens of death (BSOD), random application crashes, or missing system functions, it is often time to repair the underlying file integrity. While many users immediately seek third-party repair utilities, these tools can sometimes introduce new conflicts or contain their own malware. The built-in Windows Recovery Environment offers two powerful, native commands: System File Checker (SFC) and Deployment Image Servicing and Management (DISM). Using these tools in a specific sequence allows you to fix corrupted system files safely without installing any external software.
Understanding the Relationship Between SFC and DISM
Before running any commands, it is crucial to understand what each tool does and why they must often be used together. The System File Checker (SFC) is designed to scan protected Windows system files for corruption and replace them with cached copies from a local repository known as the Windows component store. However, SFC relies on this local cache to perform repairs. If the files within that cache are themselves corrupted, SFC will fail to fix the issue and may report that it found no integrity violations even when problems exist.
This is where Deployment Image Servicing and Management (DISM) becomes essential. DISM operates at a deeper level, repairing the Windows image itself—the source from which SFC draws its replacement files. By running DISM first, you ensure that the “clean copy” is valid. Once the image is healthy, you run SFC to apply those clean files to your live system. Skipping the DISM step often leads to incomplete repairs or persistent error messages.
How to Run the DISM Command for Image Repair
The first step in the repair process is to prepare the Windows component store using DISM. You must run this command from an elevated prompt; otherwise, you will receive permission errors that prevent the tool from modifying system files. To start, press the Windows key + R to open the Run dialog, type cmd, and press Ctrl + Shift + Enter to launch Command Prompt as an administrator. Alternatively, search for “Command Prompt” in the Start menu, right-click the result, and select “Run as administrator.”
Once the window opens, copy and paste the following command exactly as written:
dism /online /cleanup-image /restorehealth
Press Enter to execute the command. You will see a progress bar moving across the screen. This process can take several minutes, depending on your internet connection speed and system performance. DISM downloads necessary files from Windows Update servers to repair the local image. Do not close the window while this process is running. Once the command finishes, you should see a message stating that the operation completed successfully. If you encounter an error code during this step, it may indicate that your Windows Update service is blocked or that your internet connection is unstable; in such cases, ensure your system is connected to the internet and try again later.
Executing the SFC Scan After Image Repair
With the Windows image restored to a healthy state via DISM, you are now ready to run the System File Checker. Return to your elevated Command Prompt window and type the following command:
sfc /scannow
Press Enter. This command initiates a comprehensive scan of all protected system files. SFC compares each file against the clean versions stored in the repaired Windows image. If discrepancies are found, it automatically replaces the corrupted files with the correct ones. The scan typically takes between 10 to 20 minutes. During this time, you may see various percentage updates and messages indicating that Windows found corrupt files and successfully repaired them.
Interpreting SFC Scan Results and Error Codes
Understanding the output of the SFC command is vital for knowing whether further action is required. If the tool reports “Windows Resource Protection did not find any integrity violations,” your system files are healthy, and the issue likely lies elsewhere, such as with specific drivers or third-party software. However, if you see a message stating that corrupt files were found and repaired, you can restart your computer to complete the installation of the fixed files.
Sometimes, SFC may report that it could not repair some files because the Windows Resource Protection cab file is corrupted. In this scenario, the error message will often suggest running the DISM command again. This reinforces the importance of the order of operations: always repair the image with DISM before attempting to scan with SFC. If you continue to see errors after multiple attempts, it might be necessary to check your hard drive health using built-in tools like chkdsk to rule out physical disk sectors causing file corruption.
Advanced Steps When Standard Scans Fail
There are situations where the standard /scannow mode is insufficient, often due to locked files or deep-level corruption. In these cases, you can use the verbose repair flag combined with the DISM command. Type the following into your administrator Command Prompt:
sfc /scannow /purforcerepair
Note that this specific syntax may vary slightly depending on your Windows version; if that exact flag does not work, simply running sfc /scannow after a fresh DISM repair is usually sufficient. Another advanced technique involves booting into Safe Mode. Corrupted files can sometimes be locked by active processes in normal mode. Restart your computer, hold the power button to force a shutdown three times to trigger the recovery environment, select “Troubleshoot,” then “Advanced options,” and finally “Startup Settings.” Press F4 or 4 to enter Safe Mode. Once inside Safe Mode, run both the DISM and SFC commands again. This environment loads fewer drivers and services, often allowing SFC to access and repair files that are otherwise locked.
Real-World Example: Fixing a BSOD After a Windows Update
Consider a user named Sarah who recently updated her Windows 10 system and immediately began experiencing frequent blue screens of death with the error code CRITICAL_PROCESS_DIED. She tried uninstalling recent updates, but the issue persisted. Following the guide above, she opened an administrator Command Prompt and ran the DISM command first. After it completed successfully, she ran SFC. The scan detected several corrupted files related to the update process that had failed to unpack correctly during installation. SFC replaced these files using the clean image restored by DISM. Upon restarting her computer, Sarah found that the BSODs were gone, and her system stability was fully restored without needing to reinstall Windows or use any paid repair software.
Final Checklist for System File Maintenance
To maintain a healthy Windows environment and prevent future corruption, consider incorporating these steps into your routine maintenance schedule. Always keep your Windows Update service enabled so that DISM has access to the latest patch files. Regularly scan your system with SFC after major hardware changes or driver updates. If you suspect malware is causing file tampering, run a full antivirus scan before using these commands. Remember that these tools are free, safe, and built directly into Windows. By following the correct sequence of DISM followed by SFC, you can resolve most system file issues efficiently. Always verify your internet connection and ensure you have administrative privileges before beginning any repair procedure to avoid interruptions or permission errors.

