SFC and DISM get recommended constantly, usually as “just run these two commands”, and often in the wrong order. Run them the wrong way round on a machine with a damaged component store and SFC will report problems it cannot fix, which tells you nothing useful.
Here’s what each one actually does, the order that works, and how to read the log when it says it couldn’t repair something.
Quick Facts
- Run DISM first, then SFC. SFC repairs system files using the component store, so the store has to be healthy first.
sfc /scannowchecks protected system files against known-good copies.DISM /RestoreHealthrepairs the component store itself, pulling replacements from Windows Update.- Both need an elevated prompt. Neither touches your personal files.
- If DISM can’t reach Windows Update, point it at install media with
/Source. This is the fix people miss.
What each command is for
| SFC | DISM | |
| Checks | Protected system files on disk | The component store (WinSxS) |
| Repairs from | The local component store | Windows Update, or media you specify |
| Typical runtime | 5-15 minutes | 10-30 minutes, sometimes longer |
| Run it when | Files are corrupted or behaving oddly | SFC can’t repair, or updates keep failing |
| Needs internet | No | Usually yes, unless you supply a source |
The relationship is the important bit: SFC’s replacement parts come from the component store. If that store is itself damaged, SFC has nothing good to copy from, which is exactly the situation where people run SFC repeatedly and wonder why nothing improves.
The order that works
Quick Steps
- Open Terminal or Command Prompt as administrator.
- Run
DISM /Online /Cleanup-Image /ScanHealthto check whether the store is damaged. Read-only, no changes. - If it reports corruption, run
DISM /Online /Cleanup-Image /RestoreHealth. - Now run
sfc /scannow. - Run
sfc /scannowa second time. The first pass can fix things that let the second pass fix more. - Reboot, then verify whatever was broken.
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow
There’s also /CheckHealth, which is faster but only reports flags already recorded. It doesn’t scan. /ScanHealth does the actual work of looking.
When DISM can’t reach Windows Update
On a machine behind a restrictive proxy, or one pointed at a WSUS server that lacks the files, RestoreHealth fails with error 0x800f081f. That doesn’t mean the machine is unrecoverable. It means DISM had nowhere to get replacements from.
Mount an ISO matching the installed build and point DISM at it:
DISM /Online /Cleanup-Image /RestoreHealth /Source:WIM:D:\sources\install.wim:1 /LimitAccess
/LimitAccess stops it trying Windows Update at all. The build of the media should match the installed build. An older ISO often won’t have the right file versions.
Reading the log when it says it failed
SFC writes to %windir%\Logs\CBS\CBS.log, which is enormous and mostly noise. Extract just the relevant lines:
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log > "%userprofile%\Desktop\sfcdetails.txt"
Open that on your desktop and look for “Cannot repair member file”. The filename that follows is what actually failed, and searching for it usually identifies which component or driver package is damaged.
If SFC repeatedly cannot repair the same file after a successful DISM run, you’re into in-place upgrade territory. Running setup from mounted media and choosing to keep files and apps. That rebuilds system files without touching your data, and is far quicker than a rebuild.
Glossary
| Term | What it means |
| Component store | The WinSxS folder holding the master copies of Windows system files. |
| CBS.log | Component-Based Servicing log, where SFC and DISM record what they did. |
0x800f081f | Source files could not be found. DISM had no working repair source. |
| In-place upgrade | Reinstalling Windows over itself, keeping files, apps and most settings. |
/LimitAccess | Tells DISM not to contact Windows Update, using only the source you specify. |
Frequently asked questions
Should I run SFC or DISM first?
DISM first. SFC repairs using files from the component store, so if the store is damaged SFC has nothing good to copy from. Running SFC first on a damaged store is why people see “unable to fix” repeatedly.
Will SFC or DISM delete my files?
No. Both work only on Windows system files and the component store. Your documents, photos and installed programs are untouched.
How long should DISM RestoreHealth take?
Ten to thirty minutes is normal. It commonly appears to freeze at 20% for several minutes. That’s expected, leave it alone.
What if DISM fails with 0x800f081f?
It couldn’t find repair files. Mount an ISO matching your installed build and use the /Source parameter with /LimitAccess.
What if both complete but the problem remains?
Then the fault probably isn’t corrupted system files. Check Reliability Monitor for what changed around the time it started, and consider a driver or third-party software as the cause.
Gear We Recommend
Keeping recovery media and a spare drive to hand makes this kind of repair far less stressful.
Browse our Storage & Backup picks on AmazonAs an Amazon Associate, TechyGeeksHome earns from qualifying purchases
Disclosure: this post may contain affiliate links. If you buy through one of them, we may earn a small commission at no extra cost to you. We only recommend products we’ve tested or genuinely rate.
Discover more from TechyGeeksHome
Subscribe to get the latest posts sent to your email.