How to Repair Corrupted Windows System Files with the SFC and DISM Commands

Key Takeaways

Open Command Prompt or PowerShell as administrator, then run “sfc /scannow” to fix corrupted Windows System Files. If SFC fails to run properly or cannot repair the files, run “DISM /Online /Cleanup-Image /RestoreHealth” to fix any remaining issues.

The System File Checker tool built into Windows can scan your Windows system files for corruption or any other changes. If a file has been modified, it will automatically replace that file with the correct version. Here’s how to use it.

When You Should Run SFC or DISM?

If Windows is experiencing blue-screen or other crashes, applications are failing, or some Windows features just aren’t working properly, there are two system tools that might be able to help.

The System File Checker (SFC) tool built into Windows will scan your Windows system files for corruption or any other changes. If a file has been modified, it will automatically replace that file with the correct version. If the SFC command doesn’t work, you can also try the Deployment Image Servicing and Management (DISM) command on Windows 8, 10, or 11 to repair the underlying Windows system image. On Windows 7 and earlier, Microsoft offered a downloadable “System Update Readiness Tool” instead. Let’s take a look at how to use them.

Run the SFC Command to Repair System Files

Run the SFC command when troubleshooting a buggy Windows system. SFC works by scanning for and replacing system files that are corrupt, missing, or changed. Even if the SFC command doesn’t repair any files, running it will at least confirm that no system files are corrupted and then you can continue to troubleshoot your system with other methods. You can use the SFC command as long as the computer itself will start. If Windows will start normally, you can run it from an administrative command prompt. If Windows won’t start normally, you can try starting it in Safe Mode or in the recovery environment by booting from your installation media or recovery disc.

However you get to the Command Prompt — normally, Safe Mode, or recovery environment — you’ll use the command the same way. Just remember that if you start Windows normally, you will need to open the Command Prompt or PowerShell with administrative privileges. To do this, right-click the Start button and select “Command Prompt (Admin)”.

On Windows 11, you might need to select “Windows Terminal (Admin)” instead of “Command Prompt (Admin)” or “PowerShell (Admin)”.

Press Windows+X, then select

At the Command Prompt, type the following command and press Enter to run a full system scan and have SFC attempt repairs:

sfc /scannow

Command Prompt with sfc /scannow running.

Leave the Command Prompt window open until the command completes, which may take some time. If everything is fine, you’ll see the message “Windows Resource Protection did not find any integrity violations.”

If you see a “Windows Resource Protection found corrupt files but was unable to fix some of them” message, try restarting your PC in Safe Mode and running the command again. And if that fails, you can also try booting with your installation media or recovery disc and trying the command from there.

The results of scan now --- it found corrupt files.

Run the DISM Command to Repair Windows

The Deployment Image Serviving and Management (DISM) tool is used to repair Windows images. You shouldn’t normally have to run the DISM command. However, if the SFC command fails to run properly or can’t replace a corrupted file with the correct one, the DISM command — or System Update Readiness Tool in Windows 7 — can sometimes fix the underlying Windows system and make SFC run correctly.

The DISM command we’re going to use goes online (to the same source as Windows Update), fetches fresh copies of files, and then uses those to repair corrupted Windows files and repair any other problems it finds. You’ll need an active internet connection for it to work. To run the DISM command in Windows 10 or Windows 11, open Command Prompt, PowerShell, or Windows Terminal with administrative privileges, then enter:

DISM /Online /Cleanup-Image /RestoreHealth

Allow the command to finish running before closing the Command Prompt window. This may take five to ten minutes. It’s normal for the progress bar to stay at 20 percent for a while, so don’t worry about that.

Command Prompt running the DISM command.

If the results of the DISM command state that anything was changed, restart your PC and you should then be able to run the SFC command successfully.

Try a System Restore or System Reset Next

If you’re still experiencing system problems and the SFC and DISM commands don’t help, you can try more drastic actions.

Running the System Restore tool will restore your Windows operating system files, settings, and applications to an earlier state. This may fix system corruption problems if the operating system wasn’t also damaged at the earlier point when the restore point was created.

An if all else fails, you could always resort to performing a system reset or reinstalling Windows. On Windows 8, 10, and 11 you can perform a “Reset this PC” operation to reset Windows to its default state. You’ll have the option to keep your personal files in place — though you’ll have to reinstall programs — or to remove everything and do a complete reinstall. Whichever you choose, make sure you’ve backed up your PC first! On Windows 7 and earlier, this will require using your computer’s manufacturer-provided recovery partition or reinstalling Windows from scratch.

The "Reset This PC" options. Try "Keep My Files" first.

If you encounter other errors while running any of the commands we’ve covered, try searching the web for the specific errors you encounter. The commands will often point you to log files with more information if they fail — check the logs for more details about specific problems. Ultimately, it may not be worth troubleshooting serious Windows corruption problems when you can just reset Windows to its default state or reinstall it. That decision will be up to you.

Leave a Reply

Your email address will not be published. Required fields are marked *