If your computer has been acting sluggish, throwing random errors, or freezing up, your first instinct might be to download a third-party cleaner or even consider reinstalling the entire operating system.
Before you take such drastic steps, pause. Windows has powerful built-in repair tools designed specifically to find and fix corrupted system files without costing you a dime or requiring shady downloads.
In this quick guide, you will learn how to use two essential command-line tools—SFC and DISM—to bring your PC back to peak performance.
Common Causes of System File Corruption
Before jumping into the fix, it helps to know why this happens in the first place. Corrupted system files are usually the result of a sudden power loss while Windows is writing data, an update that got interrupted midway, malware that altered protected files before being removed, or a hard drive with failing sectors. Knowing the cause won't fix the problem on its own, but it explains why these issues tend to reappear if the underlying trigger — like an unstable power supply or a failing drive — isn't addressed alongside running these tools.
What You Need Before You Start
An administrator account on your PC.
A stable internet connection (required for the DISM tool to pull fresh replacement files if needed).
Step 1: Open the Command Prompt as
Administrator
To run these deep system scans, you need elevated privileges.
Press the Windows Key on your keyboard.
Type cmd in the search bar.
Right-click on Command Prompt in the results and select Run as administrator.
Click Yes if a pop-up window asks for permission to make changes to your device.
Step 2: Run the SFC (System File Checker) Scan
The System File Checker (sfc) is your first line of defense. It scans all protected operating system files and replaces corrupted, missing, or changed versions with correct cached copies.
In the black Command Prompt window, type the following command: sfc /scannow
Press Enter.
The scan will begin. It usually takes between 5 to 15 minutes. Do not close the window or turn off your PC while it runs.
Once finished, you will see one of a few messages:
"Windows Resource Protection did not find any integrity violations." (Your files are clean).
"Windows Resource Protection found corrupt files and successfully repaired them." (Success! The tool fixed your issues).
Step 3: Run the DISM Tool (If SFC Couldn't Fix Everything)
Sometimes, the local system cache used by SFC is also corrupted. If SFC reported that it couldn't repair some files, you need to turn to DISM (Deployment Image Servicing and Management). This tool repairs the underlying Windows system image using Windows Update servers.
In the same Command Prompt window, type this command: DISM /Online /Cleanup-Image /RestoreHealth
Press Enter.
The tool will connect to Microsoft servers to download healthy replacement files. This may take a little longer depending on your internet speed.
Once completed successfully, restart your computer.
Pro Tip: Run SFC One More Time
After running DISM and rebooting your PC, it is a good idea to open Command Prompt as administrator one last time and run sfc /scannow once more. This ensures that any files that couldn't be fixed initially are now successfully repaired by the freshly restored system image.
What If DISM Also Fails?
On rare occasions, both tools will come back unable to fully repair your system — usually a sign that the corruption goes deeper than individual files. If this happens, don't panic. Your next option is the built-in "Reset this PC" feature, found under Settings > System > Recovery, which lets you reinstall Windows while choosing to keep your personal files. This is far less drastic than a full clean install and takes care of stubborn corruption that SFC and DISM can't reach on their own. A full clean install using installation media should only be considered as a last resort, after Reset this PC has also failed to resolve the issue.
Frequently Asked Questions
Is it safe to run SFC and DISM on my PC?
Yes. Both are official Microsoft tools built directly into Windows, and they only replace damaged system files with verified healthy copies — they don't delete personal files, photos, or documents.
How long does DISM usually take to complete?
It depends on your internet speed and how much repair work is needed, but most scans finish within 10 to 20 minutes. A slow or unstable connection can extend this significantly.
Do I need a Windows installation disc or USB to run these commands?
No. Both SFC and DISM work using files already on your PC or downloaded directly from Microsoft's servers over your internet connection — no installation media required, unless your specific Windows setup files are also corrupted, which is uncommon.
Will running these tools delete any of my files or programs?
No. SFC and DISM only touch core operating system files. Your personal documents, photos, and installed programs are never affected.
Conclusion
You don't need to be an expert computer technician or pay for expensive optimization software to keep your computer running smoothly. By mastering these two built-in commands, you can diagnose and fix most Windows software issues in under 20 minutes.
Did this guide help fix your PC? Let us know in the comments below, and don't forget to share this post with a friend who needs it!
