Fix Corrupt Windows Files with DISM and SFC
In this article
Yes, you can fix corrupt Windows system files using the built-in DISM and SFC tools. Run DISM first to repair the Windows image, then SFC to scan and replace damaged system files. This process resolves common stability issues, boot errors, and update failures caused by file corruption. You’ll need administrator access and an active internet connection for DISM to download repair files if necessary.
What You'll Need
- Administrator account on the Windows PC
- Stable internet connection (recommended)
- Access to Command Prompt as Administrator
- About 15–30 minutes of uninterrupted time
Step-by-Step
- Press the Windows key, type "cmd", right-click on "Command Prompt", and select "Run as administrator". If prompted by User Account Control, click "Yes" to allow the app to make changes.
- In the elevated Command Prompt window, type the following command and press Enter:
dism /online /cleanup-image /checkhealth
This checks if corruption is detected in the Windows image. It runs quickly but only reports status, not repairs. - If corruption is suspected or reported, run the full repair command:
dism /online /cleanup-image /restorehealth
This command downloads replacement files from Windows Update to fix the system image. The process may take 10–20 minutes. If your internet is slow or unavailable, DISM may use a Windows installation USB as a source (see Tips). - Once DISM completes successfully, close the window and reopen Command Prompt as Administrator again. Now run the System File Checker:
sfc /scannow
This scans all protected system files and replaces incorrect versions with correct ones from the repaired image. - Wait for the scan to finish. Do not close the window or restart the PC during the scan. SFC will report one of three results: "No integrity violations", "Windows Resource Protection found corrupt files and repaired them", or "Windows Resource Protection found corrupt files but was unable to fix some of them".
- If SFC reports it repaired files, restart your computer. After reboot, open Command Prompt as Administrator again and run
sfc /scannowonce more to verify no issues remain. - If both DISM and SFC complete without errors, the system file corruption should be resolved. Test system stability and check if previous errors (like crashes or update failures) persist.
Common Mistakes
- Running SFC before DISM: If the Windows image is corrupted, SFC may fail because it relies on that image. Always run DISM first.
- Not using administrator privileges: Both DISM and SFC require elevated rights. Running Command Prompt normally will result in access denied errors.
- Interrupting the process: Stopping DISM or SFC mid-scan can leave the system in an inconsistent state. Let both tools complete fully.
- Ignoring internet requirements: DISM needs internet access to pull healthy files from Windows Update. Offline systems may require a Windows installation media as a source.
- Assuming one run is enough: If corruption was found, rerun SFC after reboot to confirm all files are fixed.
Tips
- If DISM fails due to connectivity, insert a Windows installation USB and run:
dism /online /cleanup-image /restorehealth /source:wim:drive:\sources\install.wim:1 /limitaccess
Replace "drive" with your USB letter (e.g., E:\). - Use PowerShell instead of Command Prompt if preferred—both tools work the same way in PowerShell when run as administrator.
- Check DISM logs at
C:\Windows\Logs\DISM\dism.logfor detailed error information if the command fails. - Run these tools before attempting major updates or after system crashes to maintain stability.
- Keep your system updated—regular updates reduce the chance of file corruption over time.
Troubleshooting
If DISM fails with error messages like "Component Store corruption detected", "Access denied", or "0x800f081f", try the following in order:
- Restart the PC and run the commands again—temporary glitches can interfere.
- Ensure Windows Update is working. Go to Settings > Update & Security > Windows Update and check for updates. A stalled update service can block DISM.
- Use a Windows installation USB as a repair source for DISM (see Tips section).
- If SFC reports it can’t fix some files, note the file paths in the CBS.log (
C:\Windows\Logs\CBS\CBS.log) and search Microsoft’s support site for specific solutions. - As a last resort, consider using the "Reset this PC" feature in Settings > System > Recovery. Choose "Keep my files" to reinstall Windows while preserving personal data.
Never attempt manual file replacement in System32 or other system directories—this can cause further damage.
Frequently Asked Questions
Can DISM and SFC fix all Windows problems?
No. They only repair corrupted system files. They won’t fix driver issues, malware, hardware failures, or user application errors.
How long should SFC /scannow take?
Typically 15–30 minutes. It depends on system speed and the number of files to verify. Don’t interrupt it.
Do I need to run these tools regularly?
No. Run them only when you suspect corruption—such as after crashes, failed updates, or system instability.
What if DISM fails even with a USB?
If DISM cannot repair the image using external sources, the underlying issue may be disk corruption. Run chkdsk C: /f /r first to check the drive.
Does this work on all Windows versions?
Yes. DISM and SFC are available on Windows 7, 8, 10, and 11, though DISM’s full functionality requires Windows 8 or later.
Can these tools delete my personal files?
No. DISM and SFC only affect system files. Your documents, photos, and apps remain untouched.