System files · Windows 11
Repair corrupt Windows system files with SFC and DISM
Two built-in tools repair Windows system files, and they fix different layers. DISM repairs the store of known-good files that Windows keeps on the PC. SFC compares the live system files against that store and replaces the ones that do not match. Run DISM first so the store is sound, then SFC — running SFC against a damaged store is why the repair so often reports damage it cannot fix.
What you need
- An administrator prompt. Both tools refuse to run without one. Right-click the Start button and choose Terminal (Admin).
- An internet connection for DISM. In its standard form DISM downloads clean files from Windows Update when the local store is missing something. Offline repairs are possible and covered in the snags below.
- Time. DISM can sit at one percentage for several minutes while it works. SFC usually takes ten to twenty minutes. Neither progress bar is a stall indicator on its own.
Which tool, in which order
Think of it as a parts shelf and the machine built from it. The component store, in the WinSxS folder, is the shelf. The files Windows actually runs are the machine. SFC checks the machine against the shelf. If the shelf itself holds a damaged part, SFC copies the damage back in and reports that it found corrupt files it could not fix. DISM checks and repairs the shelf. So the order is fixed: DISM first, SFC second, and SFC once more if the first pass reported repairs. Microsoft sets out the same order in Use SFC to repair missing or corrupt system files.
Repair the store with DISM
- Ask DISM whether the store is damaged. Run
DISM /Online /Cleanup-Image /CheckHealth. It answers in seconds, reporting whether corruption was detected and whether it is repairable. This step changes nothing. - Repair the store. Run
DISM /Online /Cleanup-Image /RestoreHealth. This is the slow step — it checks the store against Windows Update and replaces what is damaged. Let it run to 100% even if the bar pauses for minutes at a time. Microsoft documents each switch in Repair a Windows image. - Note the result line. "The restore operation completed successfully" means the shelf is sound. An error naming a missing source means DISM could not reach or use Windows Update — see the snags.
Repair the live files with SFC
- Run the scan. In the same administrator prompt, run
sfc /scannow. It walks every protected system file and compares it with the store you just repaired. - Restart if SFC repaired anything. Some replacements only settle after a restart. Restart, then run
sfc /scannowa second time. A clean second pass is the real finish line — the first pass can repair one file and only then see the next. - If Windows will not start, run SFC from the recovery environment instead. Boot to the recovery environment, open Command Prompt under Advanced options, and run
sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows, adjusting the drive letter if the Windows partition shows as a different letter there. The won't-boot guide covers reaching that screen.
Read the results honestly
- "Windows Resource Protection did not find any integrity violations." The system files are clean. Whatever fault sent you here lives elsewhere — a driver, a program, or hardware — and more repair passes will not change that.
- "Found corrupt files and successfully repaired them." The repair worked. Restart and test the original fault.
- "Found corrupt files but was unable to fix some of them." Run DISM RestoreHealth once more, restart, and run SFC again. If the same message returns after that full cycle, read the detail log: SFC writes to
C:\Windows\Logs\CBS\CBS.log, and searching that file for the entries tagged [SR] names the specific files it could not repair. - "Could not perform the requested operation." Microsoft's route for this message is to run the scan in Safe Mode. Start the PC in Safe Mode, open an administrator prompt there, and run the scan again.
End state
- DISM RestoreHealth completes successfully.
- A final SFC pass reports no integrity violations.
- The fault that sent you here — the crash, the failed update, the broken feature — is retested, not assumed fixed.
When it goes wrong
- DISM fails saying the source files could not be found. DISM could not use Windows Update as its source, often because update itself is broken. Fix update first with the stuck update guide, then run DISM again. A Windows install image can also serve as the source, as Microsoft's repair-an-image page describes.
- Repairs succeed and the same fault returns within days. Files do not corrupt themselves repeatedly. A drive starting to fail rewrites good files badly — check the drive with the drive health guide before running a third repair cycle.
- Everything is clean and the fault is still there. Believe the tools. Clean system files rule out one whole class of cause; move on to drivers and the change history, the way the blue screen guide works a stop code.
- Nothing repairs and Windows is broadly broken. The remaining built-in step is Reset this PC under Settings > System > Recovery, keeping your files — listed among Microsoft's recovery options in Windows.
Related fixes
-
Fix Windows Update error 0x800f081f
Error 0x800f081f means Windows Update could not find the source files it needs to finish an update. Repair the component store with DISM first, then run System File Checker, and the same update usually installs cleanly on the next try.
-
Fix the Start menu or Windows Search not opening or not finding files
Restart the shell and search processes, check the Search service, rebuild the index, then repair the system files if Start itself is damaged.
-
Fix Windows Update error 0x80070002
Windows Update error 0x80070002 means an update cannot find files it expects, usually in a damaged download cache or component store. Clear the cache first, then repair the component store with DISM and SFC in order.
-
Fix Windows Update error 0x80070490
Error 0x80070490 usually means a component Windows Update depends on is damaged or missing, so the same update fails the same way every time. Run the troubleshooter first, then repair the component store with DISM before System File Checker, and check for the update again.
Sources
- Microsoft Support, Use SFC to repair missing or corrupt system files — the DISM-then-SFC order, the result messages, and the CBS log.
- Microsoft Learn, Repair a Windows image — every DISM repair switch, including repairing from an install image as the source.
- Microsoft Support, Recovery options in Windows — System Restore and Reset this PC when repair is not enough.