How to Repair Corrupted Windows System Files Using SFC and DISM Commands

0
61


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

When should you run these commands

If Windows is experiencing a blue screen or other crashes, apps are crashing, or some Windows features just aren’t working properly, there are two system tools that might help.

RELATED: Everything you need to know about the blue screen of death

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

RELATED: How to find (and repair) corrupted system files in Windows

Run SFC command to repair system files

Run the SFC command when troubleshooting a failed Windows system. SFC works by scanning and replacing system files that are damaged, missing, or modified. 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 boots. If Windows will start normally, you can run it from an administrative command prompt. If Windows doesn’t start normally, you can try to start it in safe mode or recovery environment by booting from your installation media or recovery disc.

RELATED: How to use safe mode to fix your Windows PC (and when you should)

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

Note: In Windows 11, you may need to select “Windows Terminal (Admin)” instead of “Command Prompt (Admin)” or “PowerShell (Admin)”.

At the command prompt, type the following command and press Enter to run a full system scan and have SFC try to repair it:

sfc /scannow

Command prompt with sfc /scannow running.

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

RELATED: How to use safe mode to fix your Windows PC (and when you should)

If you see the message “Windows Resource Protection found corrupt files but was unable to repair some of them”, 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 try the command from there.

Scan results now --- found corrupt files.

Run DISM command to fix SFC issues

Normally you should not have to run the DISM command. However, if the SFC command fails or fails to replace a damaged file with the correct one, the DISM command, or the System Update Readiness Tool in Windows 7, can sometimes repair the underlying Windows system and get SFC to run properly.

To run the DISM command in Windows 8, 10, and 11, open Command Prompt, PowerShell, or Windows Terminal 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 issues it finds.

DISM /Online /Cleanup-Image /RestoreHealth

Allow the command to finish running before closing the command prompt window. This can 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 by running the DISM command.

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

In Windows 7 and earlier versions, the DISM command is not available. Instead, you can download and run Microsoft’s System Update Readiness Tool and use it to scan your system for problems and try to fix them.

Note: If you’re still using Windows 7, you’ll need to get the correct version of the Readiness Tool. The latest version available is “System Update Readiness Tool for Windows 7 for x64-based Systems (KB947821) [October 2014]. “Download that.

Try a system restore or system reset Next

If you are still having system problems and the SFC and DISM commands do not help, you can try more drastic actions.

Running the System Restore tool will restore your Windows operating system files, settings, and applications to a previous state. This can fix system corruption issues if the operating system was not also corrupted at the previous point when the restore point was created.

RELATED: How to use System Restore in Windows 10, 11, 7 and 8

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

The options

If you encounter other errors while running any of the commands we’ve covered, try searching the web for the specific errors you encounter. Commands will often prompt you to check in files with more information if they fail; check the logs for more details on specific issues. Ultimately, it may not be worth it to fix serious Windows corruption problems when you can simply reset Windows to its default state or reinstall it. That decision will be yours.