Advanced Windows 11 Troubleshooting: How to Use DISM and SFC Commands
- 37 steps
- Needs administrator rights
- Includes a restart or sign-out
DISM and SFC are built-in Windows 11 repair tools that find and fix damaged or missing system files. When your PC freezes, slows down, or shows strange error messages, these two command-line utilities scan the system and replace broken files with fresh copies.
Both tools ship with Windows 11 and are free, so you don’t need to download anything. A basic repair takes about 5 minutes in Command Prompt. A deeper repair can take 20 minutes or more, depending on your PC and internet speed. The commands are the same on Windows 11 Home and Pro.
To use DISM and SFC commands for advanced Windows 11 troubleshooting, open the Command Prompt as an administrator by typing cmd in the Start menu search bar. Run the DISM health repair command first, then run the sfc /scannow command to automatically find and fix damaged system files.
Understanding Windows System Errors
Windows system errors happen when important files get damaged or deleted. Bad updates, sudden power outages, and malware are the usual causes. These core files are the building blocks of the operating system. When they break, your computer may freeze, crash, or slow down until you repair them.
Common causes of file damage include:
- Sudden power outages or hard shutdowns
- Bad software installations or incomplete updates
- Failing storage drives
- Malware or virus attacks
When system files break, Windows 11 might show blue screens, freeze during startup, or refuse to open certain apps. Other signs are Windows Update failing over and over, or built-in features such as Settings or the Start menu not opening. Before you reinstall anything, try these two built-in commands.
If the problem started right after a hard drive error or clicking noises from the drive, check the drive’s health and back up your data first. Repair tools can’t fix a disk that is physically failing.
What Are DISM and SFC?
DISM and SFC work together. DISM stands for Deployment Image Servicing and Management and fixes the core system image. SFC stands for System File Checker. It scans your active files and replaces corrupted ones with healthy copies from that image.
DISM checks and repairs the component store, which is the master backup of your operating system. If the component store is damaged, SFC has nothing healthy to copy from, so it can’t repair your system files. DISM can fix the store by pulling good files from a healthy source, either Windows Update online or local installation media.
SFC is the everyday repair tool. It scans your protected operating system files, compares them with the component store, and replaces any damaged or missing files with healthy copies.
Always run DISM first, then SFC. That way SFC works from a healthy backup.
Preparing to Run System Repair Tools
Before you start, close all open programs, save your work, and sign in to an administrator account. DISM and SFC make deep changes to core system files, so a standard user account can't run them.
If your user account is standard, you must ask an administrator to help or sign in to an administrator account.
Also check that your PC is plugged in if it's a laptop, and don't shut it down while a scan is running. An interrupted repair can leave things worse than before. If you plan to run the online repair, make sure you're connected to the internet.
How to Open the Command Prompt as an Administrator
- Click the Start button on your taskbar.
- Type cmd into the search box. Command Prompt should appear at the top of the results.
- Right-click Command Prompt in the search results.

- Select Run as administrator from the menu.
- Click Yes if a User Account Control window asks for permission to make changes to your computer. If you're signed in with a standard account, Windows asks for an administrator password instead.
A black Command Prompt window opens, and its title bar should read "Administrator: Command Prompt". If it doesn't say Administrator, close it and start again, because the repair commands will fail without elevated rights. This elevated window is what every step below means by "open the Command Prompt as an administrator".
If you prefer Windows Terminal, you can open it as an administrator instead. The same commands work in either one.
Step 1Run the DISM Tool
The DISM tool repairs the Windows system image. You can run it in a few different ways, depending on the kind of check you want. Start with the quick health check and move on to the deeper repairs only if you need them.
Check Health Option
This command quickly checks whether your system image has been flagged as damaged. It doesn't repair anything and finishes fast.
- Open the Command Prompt as an administrator.
- Type the following command carefully:
DISM.exe /Online /Cleanup-Image /CheckHealth - Press Enter.
- Wait for the process to reach 100 percent, then read the result. It tells you whether the image is healthy or whether corruption was detected.
If it reports damage, go straight to the restore health step below. If it reports no damage, you can still run the deeper scan if the problems continue.
Scan Health Option
If the quick check finds nothing but you still suspect a problem, use the deeper scan. It examines the whole component store rather than just reading the damage flag, so it takes longer.
- Open the Command Prompt as an administrator.
- Type the following command:
DISM.exe /Online /Cleanup-Image /ScanHealth - Press Enter and wait for the scan to finish. This takes a few minutes.
The progress bar may sit at the same percentage for a while. That is normal, so don't close the window. When it finishes, the result says whether the image is healthy or repairable. This scan only reports problems and doesn't fix them.
Restore Health Option
The restore health option repairs a damaged component store by downloading fresh files from Microsoft's servers. Use it when the earlier checks report corruption, or when SFC can't repair files on its own.
- Open the Command Prompt as an administrator.
- Type the following command:
DISM.exe /Online /Cleanup-Image /RestoreHealth - Press Enter.
- Wait patiently. This can take anywhere from 10 to 20 minutes, depending on your internet and computer speed.
The progress indicator often seems to freeze at around 20 percent or 62 percent. Give it time before you assume it has hung. When it ends, you should see a message that the restore operation completed successfully.
Once DISM succeeds, run SFC in the next step. A restart isn't normally required, but restarting afterward is a good idea if Windows asks for it.
If the command fails with an error about not finding source files, check your internet connection and try again. If that doesn't help, use the offline repair method further down.
Step 2Run the System File Checker (SFC) Tool
To run System File Checker, open the Command Prompt as an administrator and run the sfc /scannow command. It scans all protected operating system files and replaces broken or missing ones with cached copies.
- Open the Command Prompt as an administrator.
- Type the following command:
sfc /scannow - Press Enter.
- Leave the window open and wait for the scan to reach 100 percent. This can take 10 to 15 minutes or longer on a slow drive.
When the scan finishes, SFC shows one of several messages:
- Windows Resource Protection did not find any integrity violations: Your computer has no damaged files.
- Windows Resource Protection found corrupt files and successfully repaired them: SFC found problems and fixed them automatically. Restart your PC to make sure the repaired files are in use.
- Windows Resource Protection found corrupt files but was unable to fix some of them: You may need to run the tool again or use advanced recovery options. Run DISM restore health first, then run SFC a second time. If that still fails, check the log as described below, or try the scan again in Safe Mode.
- Windows Resource Protection could not start the repair service: You need to start the Windows Modules Installer service. Open the Services app, find Windows Modules Installer, start it, and run SFC again.
It's common to need two SFC runs after a DISM repair. Running it more than twice rarely helps.
Advanced Troubleshooting: Offline DISM Repair Using an Install Image
Offline DISM repair lets you fix system files without an internet connection, using a local Windows installation file or a mounted ISO. It helps when your network blocks Microsoft's servers or the PC can't get online.
- Insert your Windows 11 installation media, such as a USB flash drive, or mount an ISO file. To mount an ISO, double-click it in File Explorer. Note the drive letter assigned to it, for example, letter D.
- Open the Command Prompt as an administrator.
- Type the following command, replacing the drive letter with your actual media drive letter:
DISM.exe /Online /Cleanup-Image /RestoreHealth /Source:WIM:D:\sources\install.wim:1 /LimitAccess - Press Enter and wait for the repair to complete.
The installation media should match your installed Windows 11 version and language as closely as possible. A mismatch is a common reason this repair fails. Some media store the Windows image as an install.wim file and others as an install.esd file. Browse the media's sources folder to see which one you have, and make sure the command points to that file.
When the repair completes, run SFC again to finish the job.
How to View Details of the System File Checker Process
SFC records everything it does in a hidden CBS log file. Copying that log to your desktop gives you a plain text file that shows which files SFC checked, changed, or failed to fix. This is useful when SFC reports that it couldn't repair some files.
- Open the Command Prompt as an administrator.
- Type the following command to copy the SFC log to your desktop for easy reading:
findstr /c:"" %windir%\Logs\CBS\CBS.log > "%userprofile%\Desktop\sfclogs.txt" - Press Enter.
- Go to your desktop and double-click the new file named sfclogs.txt to open it in Notepad.
- Look through the text file to see which specific files were repaired or could not be fixed.
The file can be very long. Use Ctrl+F in Notepad to search for words like "cannot repair" so you can jump to the failed files. Note the file names, since you'll need them if you try the manual replacement below. You can delete sfclogs.txt from your desktop when you're done.
How to Manually Replace a Corrupted System File
Manually replacing a corrupted system file means taking ownership of the broken file and swapping in a healthy copy from another computer or from installation media. Use this only when SFC can't repair the file itself. It's the riskiest method in this guide, because a wrong file can stop Windows from starting.
- Before you change anything, create a restore point and note the exact file name and location from the SFC log.
- Open the Command Prompt as an administrator.
- Take ownership of the broken file by typing this command:
takeown /f C:\Windows\System32\example-file.dll(Replace example-file.dll with your actual broken file name). - Press Enter.
- Grant yourself full access to the file by typing:
icacls C:\Windows\System32\example-file.dll /grant USERNAME:F(Replace USERNAME with your actual user account name). - Press Enter.
- Copy the original broken file to a safe folder first, so you can put it back if needed.
- Copy the healthy replacement file over the broken file using the copy command or by pasting it through File Explorer.
The replacement must come from the same Windows 11 version and build as your PC, ideally from a healthy computer or your installation media. After replacing the file, restart your PC and run SFC again to confirm the problem is gone. If Windows misbehaves afterward, restore the original file you saved or use your restore point.
Summary
DISM and SFC can find and fix damaged system files without a full Windows reinstall. Run them from an administrative Command Prompt in this order: DISM first, then SFC. Restart afterward and check whether the original problem is gone.
If the errors continue after both tools complete cleanly, look at other causes, such as a failing drive, bad drivers, or malware. Resetting Windows is a last resort.
Have a question about this guide?
Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.
Did this guide fix your problem?
About the Author
Richard
Tech Writer, IT Professional
Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.
No comments yet — be the first to share your thoughts!