Corrupted system files can cause a huge range of problems on Windows, from random crashes and error messages to features refusing to open at all. Fortunately, Windows includes two powerful built-in tools β€” System File Checker (SFC) and the Deployment Image Servicing and Management tool (DISM) β€” designed specifically to find and repair this kind of damage without needing a full reinstall. This guide explains what each tool does, exactly how to run them together in the right order, and what to do if they can't fix the problem alone.

What SFC and DISM actually do

  • SFC (System File Checker) scans all protected Windows system files, compares them against a cached, known-good copy stored locally, and replaces any that are missing, altered, or corrupted.
  • DISM (Deployment Image Servicing and Management) works at a lower level, repairing the Windows component store β€” the local repository SFC relies on for its known-good copies. If that store itself is damaged, SFC has nothing valid to restore from, which is why DISM is often run first, or straight after if SFC reports it "could not fix some of the files."

Running both, in the correct order, gives Windows the best chance of a full self-repair.

Before you start

Back up any important files before running system repair tools, particularly if you've been experiencing crashes or unusual behaviour. While SFC and DISM are safe, standard tools, any system already exhibiting instability is worth safeguarding data on first.

  1. Ensure you're connected to the internet, as DISM's repair source can pull replacement files from Windows Update if needed.
  2. Close all open applications to avoid file conflicts during the scan.
  3. Make sure the laptop is plugged into mains power if it's a laptop β€” an interrupted scan from a battery dying mid-process can cause further issues.

Step 1: Open Command Prompt as administrator

  1. Click the Start button, type cmd.
  2. Right-click Command Prompt in the results and choose Run as administrator (or, on Windows 11, you can use Windows Terminal in administrator mode, which works identically for these commands).
  3. Confirm the User Account Control prompt if it appears.

Step 2: Run DISM first

Running DISM before SFC ensures SFC has a healthy component store to pull repairs from.

  1. Type the following and press Enter: DISM /Online /Cleanup-Image /CheckHealth This is a quick check that reports whether corruption has been detected, without attempting a fix yet.
  2. Next, run a deeper scan: DISM /Online /Cleanup-Image /ScanHealth This takes several minutes and thoroughly checks the component store for corruption.
  3. If either check reports the image is repairable, run the actual repair: DISM /Online /Cleanup-Image /RestoreHealth This can take anywhere from 10 to 30 minutes depending on the extent of the damage and your internet connection, since it may download replacement files from Windows Update. Don't close the window or restart the computer while it's running, even if the progress bar appears to pause β€” this is normal and it will resume.

If DISM can't connect to Windows Update

If you're on a metered or restricted connection, or DISM reports it cannot find a source, you can point it to a Windows installation media source instead:

DISM /Online /Cleanup-Image /RestoreHealth /Source:WIM:D:\sources\install.wim:1 /LimitAccess

Replace D: with the drive letter of a mounted Windows ISO or USB installer matching your current Windows version. This uses local files instead of downloading from Microsoft's servers.

Step 3: Run SFC

Once DISM has completed successfully:

  1. Type: sfc /scannow
  2. Let the scan run fully β€” it typically takes 10 to 20 minutes and shows a percentage progress in the window.
  3. When complete, one of three messages will appear: - "Windows Resource Protection did not find any integrity violations" β€” no corruption was found; your issue likely lies elsewhere. - "Windows Resource Protection found corrupt files and successfully repaired them" β€” the repair worked. Restart the computer to complete the process. - "Windows Resource Protection found corrupt files but was unable to fix some of them" β€” this requires further investigation, covered below.

Step 4: If SFC couldn't fix everything

  1. Re-run DISM's /RestoreHealth once more, then SFC again β€” sometimes a second pass succeeds where the first didn't, particularly if DISM's first run itself repaired additional files that SFC then needed.
  2. Check the detailed log for which specific files failed. Open Command Prompt as administrator and run: findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt" This creates a readable text file on your desktop listing exactly which files SFC could not repair, useful if you need to search for a manual fix or ask for help in a support forum.
  3. For a small number of stubborn files, you can sometimes manually replace a corrupted system file by copying a known-good version from an identical Windows installation or extracting it from installation media using tools like expand, though this is an advanced step best reserved for confident users, as replacing the wrong file incorrectly can worsen system stability.

Step 5: Restart and verify

  1. Restart the computer to ensure all repaired files are properly loaded.
  2. Re-run sfc /scannow once more after rebooting to confirm no remaining integrity violations are found.
  3. Monitor whether the original symptoms (crashes, error messages, missing features) have stopped over the following few days of normal use.

Run these tools periodically, not just when something goes wrong. A quick sfc /scannow every few months, particularly after major Windows updates, catches quiet corruption before it causes a visible problem.

When SFC and DISM aren't enough

If corruption persists across repeated attempts, or the same files keep coming back as damaged, this usually points to one of two underlying causes:

  • A failing storage drive, where the physical medium itself is corrupting data as it's written β€” run chkdsk C: /f /r from an administrator Command Prompt to check for bad sectors, and consider a full drive health check using the manufacturer's diagnostic tool (e.g. CrystalDiskInfo for a general SMART status check).
  • Malware actively re-corrupting files, in which case a full scan with Windows Security (or a reputable second-opinion scanner such as Malwarebytes) should be run before attempting further repairs, since fixing files that are immediately re-infected achieves nothing.

Still not fixed?

If corrupted system files persist after DISM, SFC, a drive health check, and a malware scan, a clean reinstall of Windows via Settings > System > Recovery > Reset this PC is the most reliable remaining option, and will replace every system file with a fresh copy regardless of the underlying cause. Back up your personal files first, as a full reset (rather than "keep my files") gives the cleanest result when corruption has proven this persistent.


Was this guide helpful? Explore more Windows & macOS Tweaks guides, or browse all Operating System & Software articles.