Fix Corrupted Files Using Command Prompt in Windows
Corrupted system files can cause a wide range of problems in Windows, including random crashes, slow performance, missing features, application errors, Blue Screen errors, and startup issues.
These files are essential for the operating system to function correctly. When they become damaged due to sudden shutdowns, malware, failed updates, or disk errors, Windows may stop working as expected.
Fortunately, you do not always need to reinstall Windows to fix these problems. Command Prompt includes several built-in tools that can scan your computer, detect corrupted files, and automatically replace damaged system files with healthy copies.
Below, I have explained how to fix corrupted files using Command Prompt in Windows with detailed instructions.
Fix Corrupted Files Using Command Prompt in Windows
![Fix Corrupted Files Using Command Prompt in Windows [Guide]](https://gadgetsnurture.com/wp-content/uploads/2026/09/Fix-Corrupted-Files-Using-Command-Prompt-in-Windows-Guide-1024x576.jpg)
Before you begin, make sure you have saved any open work. Some repair commands may require a restart after they finish.
Step 1: Open Command Prompt as Administrator
The repair commands used in this guide require administrator privileges. If you open Command Prompt normally, some commands will fail because they do not have permission to repair protected system files.
Click the Start button and type Command Prompt into the search box. When Command Prompt appears in the results, right-click it and select Run as administrator.
If User Account Control asks whether you want to allow the app to make changes to your device, click Yes.
A Command Prompt window with administrator access will open. You can verify this because the title bar usually says Administrator: Command Prompt.
Keep this window open throughout the repair process since you will enter several commands one after another.
Step 2: Scan and Repair System Files Using the SFC Command
The System File Checker, commonly called SFC, is one of the most useful Windows repair tools. It scans protected system files and replaces corrupted versions with clean copies stored in the Windows cache.
In the Command Prompt window, type the following command exactly as shown:
sfc /scannow
Press Enter.
The scan will begin immediately. Depending on your computer’s speed and storage type, the process may take anywhere from 10 to 30 minutes.
Do not close the Command Prompt window while the scan is running. Interrupting the process may prevent Windows from completing the repair.
After the scan finishes, Windows will display one of several messages.
If you see Windows Resource Protection did not find any integrity violations, your system files are healthy.
If you see Windows Resource Protection found corrupt files and successfully repaired them, restart your computer to complete the repair.
If Windows reports that it found corrupted files but could not repair all of them, continue with the next step and use the DISM tool.
Step 3: Repair the Windows Image Using DISM
Sometimes SFC cannot repair corrupted files because the Windows component store itself has become damaged. In this situation, you should use the Deployment Image Servicing and Management, or DISM, tool.
DISM repairs the Windows image that SFC relies on to restore system files.
In the same Command Prompt window, type the following command:
DISM /Online /Cleanup-Image /RestoreHealth
Press Enter.
The repair process may appear to pause at certain percentages, but this is completely normal. Some repairs can take 20 minutes or longer depending on your system.
During the repair, DISM checks the Windows image for corruption and downloads replacement files if necessary.
Once the process reaches 100 percent, you should see a message indicating that the restore operation completed successfully.
Restart your computer after DISM finishes.
Step 4: Run the SFC Scan Again
After DISM repairs the Windows image, it is a good idea to run SFC once more.
Open Command Prompt as administrator again if you restarted your computer.
Type the following command:
sfc /scannow
Press Enter.
This second scan allows Windows to repair any remaining corrupted files that could not be fixed during the first scan.
Many users find that SFC reports successful repairs after DISM has restored the Windows component store.
When the scan completes successfully, restart your computer one more time.
Step 5: Check Your Hard Drive for File System Errors
Corrupted files can sometimes be caused by problems with the storage drive rather than Windows itself. If your drive contains bad sectors or file system errors, Windows may repeatedly develop corrupted files.
To check the drive, enter the following command:
chkdsk C: /f /r
Press Enter.
If Windows tells you that the drive is currently in use and asks whether you want to schedule the scan for the next restart, type Y and press Enter.
Restart your computer.
During startup, Windows will scan your drive for errors, repair damaged file system structures, and recover readable data from bad sectors whenever possible.
This scan may take a long time, especially if you have a large hard drive. Allow the process to finish without turning off your computer.
Step 6: Restart Windows and Check Whether the Problem Is Fixed
Once all repairs have been completed, restart your computer normally.
After Windows loads, check whether the original problem has disappeared.
Try opening the application that was crashing, access the folder that was showing errors, or perform the task that previously failed.
If your computer is now working normally, the corrupted files were likely repaired successfully.
If problems continue, consider running Windows Update to install any pending system updates before attempting additional troubleshooting.
Step 7: Check the Repair Results
If you want to know exactly what Windows repaired, you can review the repair results.
After running SFC, Windows records the scan information in its log files.
Advanced users often review these logs to determine which files were repaired or whether additional troubleshooting is needed.
Even if you do not inspect the logs, paying attention to the completion messages displayed by SFC and DISM can help you understand whether the repair was successful or if further action is required.
Use Safe Mode If Commands Fail
In some situations, corrupted files may be locked by running services or background programs.
If SFC or DISM fails repeatedly, restarting Windows in Safe Mode and running the same commands again may resolve the issue.
Safe Mode loads only the essential Windows drivers and services, reducing the chances that another application is interfering with the repair process.
Once you enter Safe Mode, open Command Prompt as administrator and repeat the SFC, DISM, and CHKDSK commands in the same order described earlier.
After the repairs are complete, restart your computer normally.
FAQs
Can Command Prompt repair all corrupted files?
No. Command Prompt can repair most corrupted Windows system files, but it cannot repair personal documents, photos, videos, or files that have been permanently damaged.
Which command should I run first?
Start with SFC because it directly checks and repairs Windows system files. If SFC cannot repair everything, run DISM and then repeat the SFC scan.
Is it safe to use SFC and DISM?
Yes. Both SFC and DISM are official Windows repair tools and are completely safe when used with the correct commands.
How long does SFC take to complete?
Most scans finish within 10 to 30 minutes. Older computers or systems with slower hard drives may require more time.
Do I need an internet connection for DISM?
Usually, yes. DISM may download healthy Windows files from Microsoft’s servers if local repair files are unavailable.
Will these commands delete my personal files?
No. These commands repair Windows system files only. Your personal documents, pictures, videos, and installed applications remain unchanged.
What should I do if SFC and DISM cannot fix the problem?
If the issue continues after running all repair commands, install the latest Windows updates, perform a System Restore, use an in place repair upgrade, or reset Windows while keeping your personal files.
Summary
Corrupted Windows system files can lead to unexpected crashes, performance problems, and operating system errors, but they can often be repaired without reinstalling Windows.
Using Command Prompt, you can run SFC to scan and repair damaged system files, DISM to restore the Windows image, and CHKDSK to fix disk related errors that may be causing file corruption.
Running these tools in the proper order gives Windows the best chance of restoring system stability.
If the problem still persists after completing all the steps, additional recovery options such as System Restore or a Windows repair installation may be necessary..
