Random crashes, apps that wonāt open, Windows Update errors that show up with no obvious trigger: corrupted system files are usually the reason. DISM and SFC can fix that without a full reinstall, but only if you run them in the right order. Get the order wrong and youāll waste twenty minutes for nothing.
SFC and DISM are Windows-only tools, built into every copy of Windows 11 and Windows 10. Thereās no macOS equivalent; macOS protects its system files with a completely different mechanism (System Integrity Protection). Everything below applies to Windows.
What Are SFC and DISM?
System File Checker (SFC) scans the Windows system files itās supposed to protect and replaces any that are missing, corrupted, or altered. DISM (Deployment Image Servicing and Management) repairs the underlying Windows component store, the āmaster copyā SFC pulls replacement files from. If that component store is damaged too, SFC has nothing good to copy from. Thatās why DISM runs first.
Before You Begin
Make sure you have:
- A Windows 11 or Windows 10 PC signed in with an administrator account
- An active internet connection (DISM downloads replacement files from Windows Update by default)
- At least 15-20 minutes of uninterrupted time; DISM alone can take 10-30 minutes
- A few GB of free disk space
- A Windows 11 installation ISO (only needed as a backup repair source if DISM canāt reach the internet)
| Requirement | Details |
|---|---|
| Device | Windows 11 or Windows 10 PC |
| OS version | Windows 10 (any supported build) or Windows 11 |
| Account | Administrator |
| Internet | Required for the default DISM repair source |
Step-by-Step Guide
Step 1: Open Command Prompt as Administrator
Both commands need elevated permissions to touch protected system files. A regular Command Prompt window wonāt cut it.
- Press the Windows key and type
cmd. - Right-click Command Prompt in the search results and select Run as administrator.
- Click Yes on the User Account Control (UAC) prompt.
You should see a window titled āAdministrator: Command Prompt.ā If the title bar just says āCommand Promptā without āAdministrator,ā close it and repeat step 2.
Step 2: Run DISM First
DISM goes before SFC because it repairs the component store SFC copies files from. Skip this step and sfc /scannow will likely report it āwas unable to fixā some files; thatās the single most common mistake here.
- Type the following command and press
Enter:
DISM /Online /Cleanup-Image /RestoreHealth
- Let it run without closing the window.
How long does this take? Usually 10 to 30 minutes, longer on a slow connection. DISM pauses at 20%, 40%, and 62% for several minutes while it verifies files against Windows Update or downloads larger components. Thatās normal, not a freeze. Donāt close the window or reboot unless itās genuinely stuck for over an hour with 0% disk or network activity.
Does it need internet? Yes, by default. DISM downloads clean replacement files from Windows Update, so it fails on an offline PC or one behind a restrictive network policy. See the troubleshooting section below if that happens.
- Wait for the completion message: āThe restore operation completed successfully.ā
Step 3: Run SFC Second
With a healthy component store in place, SFC can now find good copies of any damaged files.
- In the same window, type:
sfc /scannow
- Press
Enterand let the scan run to 100%.
The scan typically finishes in 5-15 minutes.
Step 4: Read the Result Message
SFC ends with one of three messages, and each one means something different:
- āWindows Resource Protection did not find any integrity violations.ā Your system files are fine. If the original problem is still happening, it isnāt caused by corrupted system files, so look at drivers, third-party software, or hardware instead.
- āWindows Resource Protection found corrupt files and successfully repaired them.ā The fix worked. Details are logged to
%WinDir%\Logs\CBS\CBS.log. - āWindows Resource Protection found corrupt files but was unable to fix some of them.ā SFC found damage it couldnāt repair. Move on to the next section.
Step 5: Restart Your PC
Restart Windows so any replaced system files fully take effect, then check whether the original crash, error, or freeze is gone.
If SFC Still Fails
Got āwas unable to fix some of themā? Donāt give up after one pass; this happens more than youād think.
- Run DISM again to make sure the component store is fully healthy:
DISM /Online /Cleanup-Image /RestoreHealth
- Restart the PC.
- Run
sfc /scannowa second time.
Running SFC twice, occasionally three times, resolves most files that failed on the first attempt. Each pass can fix files that were locked or in use during the previous scan.
Troubleshooting DISM Failures
DISM fails with a 0x800f081f error or āsource files could not be foundā
Why it happens: No internet connection, a corporate Group Policy that redirects Windows Update, or a corrupted local update cache is blocking DISM from downloading replacement files.
Fix: Confirm youāre online, then retry the command. If it still fails, mount a Windows 11 ISO that matches your installed build and point DISM at its install.wim file instead of Windows Update:
DISM /Online /Cleanup-Image /RestoreHealth /Source:WIM:D:\sources\install.wim:1 /LimitAccess
Replace D: with the drive letter your ISO is mounted to. /LimitAccess tells DISM to skip Windows Update entirely and use only the ISO.
āWindows Resource Protection could not perform the requested operationā
Why it happens: Another process, often the Windows Modules Installer service or a pending update, has a lock on the files SFC needs. Or Command Prompt just wasnāt opened as administrator, so check that first.
Fix: Confirm you used Run as administrator in Step 1, restart the PC to clear any pending updates, and try again. If it keeps happening, restart into Safe Mode and run sfc /scannow there.
Configuration Notes
A few flags come up often once youāre comfortable with the basics:
/Source: points DISM at an alternate repair source (like a mounted ISO) instead of Windows Update. Useful with no internet access./LimitAccess: stops DISM from contacting Windows Update at all, forcing it to use only the source you specify./scanonlyand/verifyonly: SFC switches that report problems without repairing anything. Handy if you just want a diagnostic check before committing to a fix.
Tips and Troubleshooting
- Check the detailed log: SFCās summary line doesnāt list which files it fixed. Pull the relevant entries into a readable file with:
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log > "%userprofile%\Desktop\sfclogs.txt"
Open sfclogs.txt on your desktop in Notepad afterward.
- Rule out a failing drive: If SFC keeps finding new corruption after repeated repairs, run
chkdsk /scanto rule out a disk problem rather than repeated Windows corruption. - Last resort: If DISM and SFC canāt stabilize the PC after two or three attempts, an in-place repair install (upgrading Windows over itself from an ISO) or Reset This PC keeps your files while replacing every system file at once.
Wrapping Up
DISM first, then SFC, in that order; that sequence clears up most ācorrupted filesā reports on Windows 11. Itās a genuinely reliable fix, not a shot in the dark.
If SFC still canāt fix everything after a second pass, or corruption keeps coming back within days, thatās usually a failing drive or malware, not routine Windows wear. Run a disk check or a malware scan before you burn a third repair cycle on it.
| Step | Action | Applies To |
|---|---|---|
| 1 | Open Command Prompt as administrator | Windows 11, Windows 10 |
| 2 | Run DISM /Online /Cleanup-Image /RestoreHealth | Windows 11, Windows 10 |
| 3 | Run sfc /scannow | Windows 11, Windows 10 |
| 4 | Interpret the result message | Windows 11, Windows 10 |
| 5 | Restart the PC | Windows 11, Windows 10 |
Resources
- SFC command reference (Microsoft Learn)
- Repair a Windows image using DISM (Microsoft Learn)
- DISM image management command-line options
- Use the System File Checker tool to repair missing or corrupted system files
- How to Fix DISM Error 87 on Windows 10 and Windows 11
- Windows Update Service Not Running