Restore System Files on Windows 10: Step-by-Step Guide
In this article
To restore system files on Windows 10, run the built-in System File Checker (SFC) and then DISM if needed. Open Command Prompt as administrator, type sfc /scannow, and press Enter. This scans for and replaces corrupted or missing Windows system files with a cached copy. If SFC cannot fix the problem, run DISM /Online /Cleanup-Image /RestoreHealth to repair the component store that SFC relies on. Both tools are official Microsoft utilities and are safe to run, though the scan can take 15–30 minutes. Before you start, make sure you have an administrator account and a stable power source (a laptop should be plugged in). No third-party downloads are required.
What You'll Need
- A Windows 10 PC with an administrator account (you'll need to approve the User Account Control prompt).
- AC power for laptops or a desktop UPS, so the scan isn't interrupted by a power loss.
- About 30–60 minutes of time, depending on drive speed and the number of files checked.
- An internet connection if you need to run DISM with the /RestoreHealth switch (it may download replacement files from Windows Update).
Step-by-Step
- Open Command Prompt as administrator. Click the Start button, type cmd or Command Prompt, right-click the result, and choose Run as administrator. Approve the UAC prompt. A black window with a command prompt opens. (On some builds the entry is called Command Prompt; on others you may see Windows PowerShell — either works, but the commands below are written for Command Prompt.)
- Run the System File Checker. Type
sfc /scannowand press Enter. The scan starts immediately and shows a percentage. Do not close the window or run other heavy tasks while it works. When it finishes, you'll see one of several messages: no integrity violations found, successfully repaired, unable to repair some files, or a repair pending reboot. Note which one you get. - Restart your PC. Even if SFC reports success, a restart lets Windows finish applying any replaced files. Save your work first.
- If SFC found problems it could not fix, run DISM. Open Command Prompt as administrator again and type
DISM /Online /Cleanup-Image /RestoreHealth, then press Enter. This repairs the Windows component store (the source SFC uses). It can take 10–20 minutes and may appear stuck at 20% or 40% — that is normal. Let it finish. - Re-run SFC after DISM. Once DISM completes, run
sfc /scannowagain. With a healthy component store, SFC can now replace any remaining corrupted files. - Check the results. Restart once more. If you were troubleshooting a specific error (missing DLL, app crash, blue screen), test whether it is resolved. You can also review the SFC log at
%windir%\Logs\CBS\CBS.logfor details, though it is very long and mostly for advanced users. - Use System Restore as a fallback (optional). If system files remain damaged, you can roll back to a restore point. Type Create a restore point in Start, open the System Properties window, click System Restore, and follow the wizard to pick a point before the problem started. This reverts system files and settings but not your personal documents. It requires that System Protection was already enabled and a restore point exists.
Common Mistakes
- Running the commands in a normal (non-elevated) Command Prompt. SFC and DISM need administrator rights; otherwise they fail with an access-denied message.
- Closing the window too early. The scan may look frozen at a percentage for several minutes. Let it run to completion.
- Skipping DISM when SFC says it cannot repair files. SFC pulls replacements from the component store; if that store is damaged, SFC cannot succeed until DISM repairs it.
- Typing the commands with wrong spacing or slashes. Use forward slashes exactly as shown:
/scannow,/Online,/Cleanup-Image,/RestoreHealth. - Assuming SFC fixes user files or app data. It only repairs protected Windows system files, not documents, photos, or third-party programs.
- Interrupting a DISM download. If the internet drops mid-repair, rerun the command; do not force-close the window.
Tips
- Run these scans after Windows Update finishes, not during, to avoid file locks.
- If you use a third-party antivirus, temporarily disabling real-time protection can prevent it from interfering with SFC. Re-enable it afterward.
- Keep at least 1–2 GB free on the system drive; DISM may need temporary space.
- For a quick check of drive health before scanning, run
chkdsk C: /scanin an elevated prompt (read-only scan; it does not fix anything until you run it without /scan). - Create a restore point before making major changes, so you have a rollback option.
Troubleshooting
SFC says "Windows Resource Protection could not perform the requested operation." This usually means another process is using the files or the component store is damaged. Run DISM /RestoreHealth first, restart, then retry SFC in Safe Mode (hold Shift while clicking Restart, then choose Troubleshoot > Advanced options > Startup Settings > Restart, and select Safe Mode).
DISM fails with error 0x800f081f. The component store cannot find a source. Check your internet connection and Windows Update service, then rerun the command. If it persists, you may need installation media as a repair source, but that is an advanced step.
SFC completes but the problem remains. The issue may not be a system file. Check Event Viewer for the specific error, update your drivers, or use System Restore to roll back to a working state.
Commands are not recognized. Confirm you are in Command Prompt, not PowerShell (though PowerShell accepts them too). If you see "'sfc' is not recognized," you may have mistyped it or opened a restricted environment; close and reopen as administrator.
Scan stuck at a percentage for a long time. This can happen on slow drives. Wait at least 30 minutes before assuming it is frozen. If it truly hangs, restart and try again; a chkdsk scan may help.
Frequently Asked Questions
Does SFC /scannow delete my personal files?
No. It only replaces protected Windows system files. Your documents, photos, and installed apps are not touched.
How long does the scan take?
Typically 15–30 minutes for SFC and 10–20 minutes for DISM, depending on drive speed and system condition. It can be longer on older hardware.
Can I run these commands on Windows 11?
Yes, SFC and DISM work the same way on Windows 11. The steps and command syntax are identical.
Do I need an internet connection?
Not for SFC. DISM /RestoreHealth may use Windows Update to fetch replacement files, so an internet connection is recommended.
What if SFC finds no problems but my PC still crashes?
System file corruption may not be the cause. Check for driver updates, run a memory test, or review Event Viewer for hardware-related errors.
Is it safe to stop the scan?
It is better to let it finish. Stopping mid-scan is unlikely to damage files, but you won't get a complete repair. If you must stop, restart and run it again later.