SFC and DISM: the 2 Commands That Fix Windows Before You Even Think About Reinstalling
Step-by-step guide to repairing corrupted Windows 10 and 11 system files with DISM and SFC — in the right order, reading each result and knowing what to do when the repair fails.
The full repair, in order:
- Open the terminal as administrator (Win + X → Terminal (Admin)).
- 1st DISM:
DISM /Online /Cleanup-Image /RestoreHealth— fixes the “source” Windows uses to repair itself. - 2nd SFC:
sfc /scannow— checks and replaces corrupted system files. - Restart and check whether the problem is gone.
- If DISM fails, you can use an official Windows image as the repair source — without reinstalling anything.
- Introduction
- When These Commands Help (and When They Don’t)
- Opening the Terminal as Administrator
- DISM: Fixing Windows’ Repair Source
- SFC /scannow: Checking and Replacing Corrupted Files
- The Complete Sequence, Ready to Copy
- Reading the SFC Report (CBS.log)
- Using the Official Windows Image as the Repair Source
- What If Windows Won’t Even Boot?
- Bonus: Freeing Up Space with DISM
- Alternatives Table
- Before Reinstalling: the Last Resorts
- Frequently Asked Questions
🔧 Why Try SFC and DISM Before Reinstalling Windows
A clean install fixes a lot, but it comes at a price: hours reinstalling programs, redoing every setting and, if your backup isn’t up to date, lost files. Many of the problems that push people to reinstall, however, come from corrupted system files — caused by a power cut during an update, a forced shutdown, a drive with bad sectors or a program that overwrote something it shouldn’t have.
For these cases, Windows 10 and 11 ship with two repair tools that work together: DISM, which repairs the “reserve” of original system files, and SFC, which compares the files in use against that reserve and replaces anything that’s damaged. Neither of them touches your documents, photos or programs.
In this step-by-step guide you’ll run both in the recommended order, understand every message they show and learn what to do if the repair doesn’t work. In my post about 10 commands to speed up Windows I mentioned SFC briefly; this is the complete guide.

🩺 When These Commands Help (and When They Don’t)
| Symptom | Do SFC + DISM help? |
|---|---|
| Start menu, taskbar or Settings won’t open | ✅ Often |
| Windows Update always fails with the same error | ✅ Often |
| Random blue screens after a power outage | ✅ Worth trying |
| Built-in Windows apps closing on their own | ✅ Worth trying |
| Slow PC because of low memory or too many programs | ❌ Not a file corruption issue |
| Active virus | ❌ Remove the threat first, then run the repair |
| Physically failing HDD/SSD | ❌ The problem is the hardware |
If you suspect the drive, check its health first with the 4 commands that reveal your PC’s real health — repairing files on a dying drive is a losing battle.
🛡️ Opening the Terminal as Administrator
- Press Win + X (or right-click the Start button).
- Choose Terminal (Admin) on Windows 11 or Windows PowerShell (Admin) on Windows 10.
- Click Yes on the User Account Control prompt.
Without administrator rights, both commands stop right at the start with a warning. Before you begin, close open programs, plug your laptop into the charger and make sure the internet is working — DISM downloads original files through Windows Update.
🧰 DISM: Fixing Windows’ Repair Source
DISM (Deployment Image Servicing and Management) takes care of the Windows image, the reserve of original files that SFC uses as its reference. If that reserve is damaged, SFC has nowhere to get good copies from — that’s why Microsoft recommends running DISM first. DISM has three levels:
| Command | What it does | Time |
|---|---|---|
DISM /Online /Cleanup-Image /CheckHealth | Only checks whether corruption has already been flagged | Seconds |
DISM /Online /Cleanup-Image /ScanHealth | Runs a full scan without fixing anything | 5 to 15 min |
DISM /Online /Cleanup-Image /RestoreHealth | Scans and repairs, downloading original files from Windows Update | 10 to 30 min |
In practice, you can go straight to the one that fixes things:
DISM /Online /Cleanup-Image /RestoreHealth
| Message at the end | Meaning |
|---|---|
| “The restore operation completed successfully.” | Repair source fixed (or it was already fine) — move on to SFC |
| “The source files could not be found.” | Windows Update couldn’t provide the files — use Step 6 (official image) |
| Error 0x800f081f or 0x800f0906 | Same as above: no repair source available |
🔍 SFC /scannow: Checking and Replacing Corrupted Files
With the repair source in order, run the System File Checker:
| Field | Detail |
|---|---|
| Command | sfc /scannow |
| Time | 5 to 20 minutes |
| Needs admin? | Yes |
SFC goes through every protected Windows file, compares it with the original version and automatically replaces the ones that don’t match. At the end, it shows one of these messages:
| Message | What to do |
|---|---|
| “Windows Resource Protection did not find any integrity violations.” | System files are fine — the problem is somewhere else |
| “Windows Resource Protection found corrupt files and successfully repaired them.” | Restart and test — very often the problem ends here |
| “Windows Resource Protection found corrupt files but was unable to fix some of them.” | Run DISM again, then SFC once more; if it persists, see Steps 5 and 6 |
| “Windows Resource Protection could not perform the requested operation.” | Run SFC in Safe Mode or outside Windows (Step 7) |

🔁 The Complete Sequence, Ready to Copy
If you’d rather let everything run in one go, paste the block below into the terminal as administrator and go grab a coffee:
DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannowWhen both finish, restart the computer. Some repairs are only applied during the restart. If SFC fixed something, it’s worth running sfc /scannow a second time after restarting, to confirm it ends with “did not find any integrity violations”.
📄 Reading the SFC Report (CBS.log)
Everything SFC does is recorded in C:\Windows\Logs\CBS\CBS.log, a huge file that’s hard to read. This command extracts only the SFC lines and saves a text file to your desktop:
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log > "%userprofile%\Desktop\sfc-details.txt"Open sfc-details.txt and look for “Cannot repair”: that’s where the name of each problematic file appears. This helps you search for the specific problem or show it to a technician.
Select-String -Path $env:windir\Logs\CBS\CBS.log -Pattern '\[SR\]' | Out-File $env:USERPROFILE\Desktop\sfc-details.txt.💿 Using the Official Windows Image as the Repair Source
If DISM complains that it couldn’t find the source files, you can hand it a clean copy of Windows — without installing anything on top:
- Download the official ISO image of the same Windows version you have (10 or 11) from Microsoft’s website.
- Double-click the ISO file: Windows mounts it as if it were a DVD, with its own drive letter (for example, E:).
- Find the index of your edition (Home, Pro…) with the command below, replacing E: with the letter that appeared.
DISM /Get-WimInfo /WimFile:E:\sources\install.wimIf the file is called install.esd instead of install.wim, change the name in the command. Write down the Index number of your edition and run the repair using the image:
DISM /Online /Cleanup-Image /RestoreHealth /Source:WIM:E:\sources\install.wim:6 /LimitAccess
With install.esd, that part becomes /Source:ESD:E:\sources\install.esd:6. Then run sfc /scannow again.
🚑 What If Windows Won’t Even Boot?
If Windows never reaches the desktop, you can run SFC from the Windows Recovery Environment:
- Force the PC off 3 times while it’s loading — on the third boot, Windows opens Automatic Repair (or boot from an installation USB drive and choose Repair your computer).
- Go to Advanced options → Troubleshoot → Advanced options → Command Prompt.
- Find the Windows drive letter (in this environment it isn’t always C:) with
dir C:\Windows,dir D:\Windows… - Run SFC pointing to the installation:
sfc /scannow /offbootdir=C:\ /offwindir=C:\WindowsIf the drive is the problem, my guide CHKDSK: when to use it and when to avoid it explains how to handle it safely. And if blue screens are the main symptom, see how to read the blue screen error code.
🧹 Bonus: Freeing Up Space with DISM
The same DISM tool has a cleanup function: it removes old versions of components that are kept around after updates.
| Command | What it does |
|---|---|
DISM /Online /Cleanup-Image /AnalyzeComponentStore | Shows how much space the component store uses and whether a cleanup is recommended |
DISM /Online /Cleanup-Image /StartComponentCleanup | Removes old versions that are no longer needed |
After the cleanup, some older updates can no longer be uninstalled — so only do it once the system has been stable for a few days. For other ways to free up space, see how to free up space on your computer.
🔁 Alternatives Table
| If this fails… | Alternative | Note |
|---|---|---|
DISM /Online /Cleanup-Image /RestoreHealth | Repair-WindowsImage -Online -RestoreHealth | Same repair through PowerShell (Admin) |
DISM /Online /Cleanup-Image /ScanHealth | Repair-WindowsImage -Online -ScanHealth | Scan through PowerShell |
| DISM stuck at 20% or 62.3% | Wait up to 30 minutes | It’s common; interrupting can make things worse |
| “You must be an administrator” | Open Terminal (Admin) | Without elevation, the commands won’t run |
| DISM can’t reach Windows Update | Use the official ISO (Step 6) | Works offline |
| SFC won’t run inside Windows | Run it from Recovery (Step 7) | Use /offbootdir and /offwindir |
🧭 Before Reinstalling: the Last Resorts
If SFC and DISM didn’t solve it, there are still options before wiping everything:
- System Restore to a point before the problem started — I explain it in how to restore Windows without losing files.
- Reinstall through Windows Update: on Windows 11, go to Settings → System → Recovery → Fix problems using Windows Update, which reinstalls the system while keeping your files and programs.
- Reset this PC keeping your personal files (programs will need to be reinstalled).
And before any of these, make a backup — the step-by-step is in full Windows backup.
FAQ
Do SFC and DISM delete my files?
No. They only check and replace operating system files. Documents, photos and programs are not affected.
Which should I run first, SFC or DISM?
On Windows 10 and 11, the recommendation is to run DISM with RestoreHealth first and then sfc /scannow, because SFC relies on the image that DISM repairs.
DISM is stuck at 20%. What now?
Wait. It’s common for it to sit for several minutes at 20% or 62.3%. Only consider stopping it after more than an hour with no change at all.
Do I need internet for DISM?
For the standard RestoreHealth, yes, because it downloads files from Windows Update. Without internet, use an official ISO as the repair source.
SFC says it was unable to fix some files. What should I do?
Run DISM with RestoreHealth, restart and run SFC again. If it continues, use the official ISO as the source or run SFC from the recovery environment.
Can I run these commands often?
There’s no harm, but there’s also no benefit in running them without a reason. Use them when there are signs of corrupted files.
Does it work on Windows 10?
Yes. SFC and DISM work on Windows 10 and Windows 11 with the same commands.
How long does the full repair take?
Usually 20 to 40 minutes for both commands combined, depending on the computer and the internet connection.
🎮 How much did you learn?
Once you pick an answer it locks in — reload the page to try again.
1. Which command should run first on Windows 10/11?
2. What does SFC do?
3. What should you do if DISM can’t find the source files?
4. Where is SFC’s detailed log stored?
5. Do SFC and DISM delete your documents?
Esse conteúdo ajudou você?
Compartilha com alguém que também vai curtir — é rapidinho e ajuda muito o nosso trabalho a chegar em mais gente.
Conhecimento só tem valor quando compartilhado.
Manter essa estrutura de laboratórios funcionando e produzir conteúdos de engenharia de forma totalmente gratuita e acessível exige tempo e dedicação diária à bancada. Esse guia salvou os seus arquivos? Você pode contribuir diretamente para manter o nosso trabalho independente forte. Apoie doando qualquer valor!
Quer apoiar a nossa bancada independente?
[email protected]