How to repair corrupted windows system files with the sfc and dism commands

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 with administrative privileges. To do this, right-click the Start button and select “Command Prompt (Admin)”.

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.

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.

To run the DISM command in Windows 8 and 10, open a Command Prompt with administrative privileges. Type the following command and then press Enter to have DISM check your Windows component store for corruption and automatically fix any problems it finds. DISM /Online /Cleanup-Image /RestoreHealth

On Windows 7 and earlier, the DISM command isn’t available. Instead, you can download and run the System Update Readiness Tool from Microsoft and use it to scan your system for problems and attempt to fix them. Try a System Restore or System Reset Next

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 and 10, 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.

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.