If Windows 11 is acting up—random crashes, slow performance, or errors that won’t go away—corrupted system files are often the culprit. Running the System File Checker (SFC) and Deployment Imaging Service and Management (DISM) tools can find and repair those files. This guide walks you through running both tools in the correct order and what to do if they don’t fix the problem.
What You’ll Need
- A Windows 11 PC with administrative access
- An internet connection (for DISM to download repair files from Windows Update)
- About 15–30 minutes of time; the scans can take a while
- Patience—do not interrupt the scans once they start
Step-by-Step
- Close all open programs. Save your work and exit any running applications. This reduces interference and speeds up the scan.
- Open Command Prompt as Administrator. Click the Start button, type
cmd, right-click on “Command Prompt” and select “Run as administrator.” If prompted by User Account Control, click “Yes.” - Run DISM first. In the Command Prompt window, type the following command and press Enter:
DISM /Online /Cleanup-Image /RestoreHealth
This scans the Windows image for corruption and repairs it using Windows Update. It may take 10–20 minutes. You’ll see a progress bar; let it finish. - Wait for DISM to complete. When done, you’ll see “The restore operation completed successfully” or “The operation completed successfully.” If it says “Error 87” or “Error 87 (0x80070057)”, you likely typed the command wrong—check for spaces.
- Run SFC now. In the same Command Prompt window, type
sfc /scannowand press Enter. This verifies all protected system files and replaces corrupted ones. It takes 10–15 minutes. - Wait for SFC to finish. You’ll see one of these messages:
– “Windows Resource Protection did not find any integrity violations” – great, no issues found.
– “Windows Resource Protection found corrupt files and successfully repaired them” – repairs were made.
– “Windows Resource Protection found corrupt files but was unable to fix some of them” – you’ll need to take extra steps (see Troubleshooting). - Restart your PC. After both scans complete, restart your computer to apply any fixes.
- Check if the problem is resolved. Try the action that was failing before. If it works, you’re done.
Common Mistakes
- Running SFC before DISM. SFC repairs files from a local cache; if that cache is corrupted, SFC fails. DISM fixes the cache first, so always run DISM first.
- Not using an elevated Command Prompt. If you run SFC or DISM without admin rights, you’ll get “You must be an administrator running a console session.” Right-click and choose “Run as administrator.”
- Interrupting the scan. Closing the Command Prompt or restarting mid-scan can leave the system in a worse state. Let it run to completion.
- Typing the DISM command incorrectly. The correct syntax is
DISM /Online /Cleanup-Image /RestoreHealth. Missing a space or using lowercase can cause errors. - Assuming SFC fixes everything. SFC only repairs system files; it won’t fix driver issues, malware, or hardware problems.
Tips
- Run DISM with a source. If Windows Update is unavailable, you can specify a source:
DISM /Online /Cleanup-Image /RestoreHealth /Source:C:\RepairSource\Windows /LimitAccess. You’ll need a Windows 11 installation media or an ISO mounted as a drive. - Check the CBS log. If SFC fails, look at
C:\Windows\Logs\CBS\CBS.logfor details. It’s a large file; search for “Cannot repair” or “Error” to find specific issues. - Use the Deployment Imaging and Servicing Management tool for offline images. If you have a Windows 11 image (WIM or VHD), you can repair it offline with
DISM /Image:C:\offline /Cleanup-Image /RestoreHealth. - Create a restore point before running these tools. Right-click Start > System > System Protection > Create. This gives you a rollback point if something goes wrong.
- Run a disk check as well. Corrupted sectors on your hard drive can cause file corruption. Open Command Prompt as admin and run
chkdsk /f /r(you’ll need to restart).
Troubleshooting
If DISM fails with “Error 0x800f081f” – This means it couldn’t find the source files. Try using the /Source parameter with a Windows 11 ISO or installation media. Mount the ISO, note the drive letter (e.g., E:), and run:DISM /Online /Cleanup-Image /RestoreHealth /Source:E:\sources\install.wim /LimitAccess
If SFC says it can’t fix some files – First, run DISM again (sometimes a second pass helps). If it still fails, boot into Safe Mode and run SFC again. To enter Safe Mode: Settings > System > Recovery > Advanced startup > Restart now. Then choose Troubleshoot > Advanced options > Startup Settings > Restart, then press 4 for Safe Mode.
If the scans complete but the problem persists – The issue might not be system file corruption. Consider:
– Running a full antivirus scan (Windows Defender offline scan).
– Updating your drivers, especially graphics and chipset drivers.
– Checking for Windows Updates (Settings > Windows Update).
– Using System Restore to revert to a point before the issue started.
If Command Prompt won’t open as administrator – Try opening Task Manager (Ctrl+Shift+Esc), click File > Run new task, check “Create this task with administrative privileges,” type cmd, and press Enter.
If you get “The system cannot find the file specified” – Ensure you’re typing the commands exactly. Also, run DISM /Online /Cleanup-Image /StartComponentCleanup first to clean up the component store, then try RestoreHealth again.
Frequently Asked Questions
Q: How long do DISM and SFC take?
A: DISM typically takes 10–20 minutes, SFC 10–15 minutes. Times vary based on your system speed and the extent of corruption.
Q: Can I run SFC and DISM at the same time?
A: No, run them sequentially. DISM first, then SFC. Running them concurrently can cause conflicts and errors.
Q: Do I need to be online for DISM?
A: Yes, DISM uses Windows Update to download healthy files. If you’re offline, you’ll need to specify a local source with the /Source parameter.
Q: Will these tools delete my personal files?
A: No, they only repair system files. Your documents, photos, and other personal data are untouched.
Q: What if SFC finds corrupt files but can’t repair them?
A: Try running DISM again, then SFC. If it still fails, boot into Safe Mode and run SFC. As a last resort, consider a repair install of Windows 11 using the installation media (keeps your files).
Q: Is it safe to cancel the scan if it’s taking too long?
A: No. Interrupting the scan can leave your system in an inconsistent state. Let it finish, even if it takes over 30 minutes.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Gmail Gemini Privacy: Data Access & Limit Settings
- Fix Outlook Inbox Corruption with DISM in Windows
- How to Set Up Apple Pay on iPhone
- How to Choose a Refurbished iPhone With Years of Support
- Voice Dictation in Google Docs: How to Use It
- Turn Off Message Notifications on Mac