sfc /scannow
Run System File Checker to scan and repair corrupted Windows files.
sfc /scannow
Command: sfc /scannow
Category: Diagnostics
Type: CMD
Purpose
Runs the System File Checker (SFC) utility to scan all protected Windows system files and repairs corrupted or modified files by replacing them with correct versions from the Windows component store. Essential for fixing system instability, crashes, and errors caused by corrupted system files.
Quick Summary
System File Checker is your go-to tool for repairing corrupted Windows system files. One command scans and automatically fixes thousands of critical Windows files. Essential when Windows is behaving strangely, applications crash unexpectedly, or after malware removal. Safe to run anytime—it only fixes files that need repairing.
How to Use
- Open Command Prompt as Administrator.
- Type
sfc /scannowand press Enter. - Wait for the scan to complete (typically 15-30 minutes).
- Review the results and follow recommended actions.
- Restart your computer if repairs were made.
Important: Must run as Administrator for the command to work.
Tips and Best Practices
- Always run as Administrator - Absolutely required.
- Be patient - Scan takes 15-30 minutes; progress may seem stuck but it's working.
- Don't interrupt - Closing the window mid-scan could cause more corruption.
- Run DISM first if SFC fails - DISM repairs the component store that SFC uses.
- Restart after repairs - Ensures fixed files are loaded properly.
- Check CBS.log for details - Detailed log at
C:\Windows\Logs\CBS\CBS.log - Run in Safe Mode if needed - If SFC can't run normally, try Safe Mode.
Common Use Cases
- System instability: Random crashes, freezes, or Blue Screens of Death.
- Application errors: Programs crash or won't start due to missing/corrupt system files.
- After malware removal: Repair system files damaged by malware.
- Windows Update failures: Fix corrupted files preventing updates.
- DLL errors: Missing or corrupted DLL errors.
- System preparation: Run before major updates or as preventive maintenance.
Prerequisites
- Administrator rights required (mandatory)
- Windows Command Prompt or PowerShell
- Available on Windows Vista and later
- Adequate disk space (at least 5-10 GB free recommended)
- Internet connection helpful for DISM if component store needs repair
Understanding the Results
Possible outcomes:
"Windows Resource Protection did not find any integrity violations."
- All system files are healthy
- No repairs needed
"Windows Resource Protection found corrupt files and successfully repaired them."
- ✅ Corrupted files were found and fixed
- Check CBS.log for details
- Restart recommended
"Windows Resource Protection found corrupt files but was unable to fix some of them."
- ⚠️ Found corruption but couldn't repair all files
- Run DISM first, then SFC again
- Check CBS.log for specific files
"Windows Resource Protection could not perform the requested operation."
- ❌ SFC couldn't run (usually permission issue)
- Ensure running as Administrator
- Try Safe Mode or from installation media
When SFC Can't Fix Files
If SFC reports "unable to fix some of them":
-
Run DISM to repair component store:
dism /online /cleanup-image /restorehealth -
Run SFC again:
sfc /scannow -
Check CBS.log for details:
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log > "%userprofile%\Desktop\sfcdetails.txt" -
If still failing: May need to use installation media or consider in-place upgrade.
Viewing Detailed Results
Check the CBS log:
notepad C:\Windows\Logs\CBS\CBS.log
Extract SFC-specific entries:
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log > "%userprofile%\Desktop\sfcdetails.txt"
Log entries explained:
- [SR] Verifying... - Currently checking a file
- [SR] Repairing... - Fixing a corrupted file
- [SR] Cannot repair... - File is corrupt but can't be fixed
Other SFC Commands
Scan without repairing (verify only):
sfc /verifyonly
Scan a specific file:
sfc /scanfile=C:\Windows\System32\kernel32.dll
Verify a specific file:
sfc /verifyfile=C:\Windows\System32\kernel32.dll
Scan offline Windows installation:
sfc /scannow /offbootdir=C:\ /offwindir=D:\Windows
Troubleshooting
- "Access denied" - Must run Command Prompt as Administrator.
- "Windows Resource Protection could not start the repair service" - Windows Modules Installer service may be disabled; enable it.
- Scan stuck at a percentage - Normal; some files take longer. Wait at least 1 hour before concluding it's stuck.
- "Protection could not perform the requested operation" - Try running in Safe Mode.
- SFC can't fix files - Run DISM RestoreHealth first, then SFC again.
- Files revert after repair - Malware may be re-corrupting files; run antivirus scan.
Running SFC in Safe Mode
If SFC fails in normal mode:
-
Boot into Safe Mode:
- Settings > Update & Security > Recovery > Advanced startup
- Or shift-click Restart from Start menu
- Troubleshoot > Advanced options > Startup Settings > Restart > F4 for Safe Mode
-
Open Command Prompt as Administrator
-
Run
sfc /scannow
Complete Repair Sequence
For best results, follow this order:
-
Check disk for errors:
chkdsk /f C:(Restart may be required)
-
Repair Windows image:
dism /online /cleanup-image /restorehealth(Takes 15-30 minutes)
-
Scan and repair system files:
sfc /scannow(Takes 15-30 minutes)
-
Restart computer
-
Verify fixes:
- Test previously failing applications
- Check for improved stability
What SFC Checks and Repairs
SFC scans and repairs:
- Windows system files in
C:\Windows\System32 - Critical DLLs and executables
- Windows PE files
- Manifests and catalogs
- Files listed in the Windows component store
SFC does NOT repair:
- User data files
- Third-party application files
- Registry entries (use DISM for some registry issues)
- Hardware drivers (use Device Manager)
Preventing File Corruption
Best practices:
- Keep Windows updated
- Use proper shutdown procedures (don't force power off)
- Run regular malware scans
- Keep adequate free disk space
- Use reliable power supply (UPS for desktops)
- Run SFC periodically as preventive maintenance
Alternative and Complementary Tools
DISM:
- Repairs Windows image and component store
- Run before SFC if SFC can't fix files
CHKDSK:
- Checks and repairs file system errors
- Run before SFC if disk errors suspected
Windows Installation Media:
- Can run SFC against offline Windows installation
- Last resort for severe corruption
PowerShell Equivalent
Run SFC from PowerShell:
sfc /scannow
Check if SFC is needed (check component store health):
Repair-WindowsImage -Online -ScanHealth
Repair component store:
Repair-WindowsImage -Online -RestoreHealth
Related Tools
dism /online /cleanup-image /restorehealth- Repair Windows component storechkdsk /f- Check and repair disk errors- Windows Update - Keep system files current
Get-WindowsImage(PowerShell) - Check Windows image health- Windows installation media - For offline repairs
- System Restore - Restore to previous working state