Introduction
When Windows update installations fail repeatedly, system applications crash silently, or blue screens of death (BSODs) become frequent, the culprit is often a corrupted Windows Component Store (WinSxS) or missing system files. Instead of resorting to a full Windows reinstall, administrators can use two powerful built-in command-line tools: the Deployment Image Servicing and Management (DISM) tool and the System File Checker (SFC). This guide explains the correct sequence for running these tools to repair the operating system.
Understanding DISM and SFC
SFC (System File Checker) scans the integrity of all protected system files and replaces incorrect or corrupted versions with correct Microsoft versions. However, SFC relies on a local hidden cache located in the Windows Component Store.
DISM (Deployment Image Servicing and Management) repairs the Windows Component Store itself by downloading healthy replacement files directly from Windows Update. Therefore, if the local cache is corrupted, running SFC first will fail. You must always run DISM before SFC.
Step 1: Open an Elevated Command Prompt
Both tools require administrative privileges to modify system files. Press the Windows Key, type cmd, right-click on Command Prompt, and select Run as administrator.
Step 2: Run the DISM CheckHealth Command (Optional)
You can quickly check if the system detects corruption without actually performing a repair. This command takes less than a minute:
DISM /Online /Cleanup-Image /CheckHealth
If it returns “No component store corruption detected,” you can still proceed to the repair step to be absolutely certain.
Step 3: Run the DISM RestoreHealth Command
This is the critical step that connects to Windows Update to download healthy files and repair the local WinSxS folder.
DISM /Online /Cleanup-Image /RestoreHealth
This process typically takes 10 to 30 minutes depending on your internet connection speed and the extent of the corruption. Do not close the window if the progress bar appears to stall at 20% or 40%; this is normal behavior.
Step 4: Using a Local Source for DISM (Offline Repair)
If the machine has no internet access or Windows Update is entirely broken, you can point DISM to a local Windows ISO file or an installation USB drive. Mount the ISO (e.g., to drive letter E:) and run:
DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:E:\Sources\install.wim:1 /LimitAccess
(Note: Replace install.wim with install.esd if that is what your installation media contains).
Step 5: Run the System File Checker (SFC)
Once DISM successfully reports that the restore operation completed, the local component store is healthy. Now, you can run SFC to repair the actual operating system files relying on that store.
sfc /scannow
Wait for the verification phase to reach 100%. SFC will output one of three messages:
- “Windows Resource Protection did not find any integrity violations.” (Your system is healthy).
- “Windows Resource Protection found corrupt files and successfully repaired them.” (The repair worked).
- “Windows Resource Protection found corrupt files but was unable to fix some of them.” (Check the CBS.log file for deeper issues).
After both DISM and SFC complete successfully, restart your computer to apply the final changes.