What is sfc?
sfc.exe, System File Checker, verifies the operating system files protected by Windows Resource Protection, such as core DLLs and executables in System32. When one has been modified, corrupted or deleted, sfc replaces it with a known-good copy from the Windows component store in C:\Windows\WinSxS. It works only on Windows' own files, not on third-party programs or personal data.
Running sfc
Open Command Prompt or PowerShell with Run as administrator. From a standard prompt, sfc refuses to run and says you must be an administrator. Typing sfc on its own only prints help.
sfc /scannowscans every protected file and repairs what it can.sfc /verifyonlyscans and reports without changing anything.sfc /scanfile=C:\Windows\System32\example.dllchecks and repairs one file;/verifyfile=only checks it.sfc /scannow /offbootdir=D:\ /offwindir=D:\Windowsrepairs an installation that will not boot, run from the Windows Recovery Environment Command Prompt, where the Windows drive is often not C:.
A full scan takes several minutes. Let it finish, and keep a laptop on AC power.
Reading the results
| Message (Windows Resource Protection...) | Meaning and next step |
|---|---|
| did not find any integrity violations | System files are fine; look at drivers, apps, the disk or hardware instead |
| found corrupt files and successfully repaired them | Restart and test again |
| found corrupt files but was unable to fix some of them | The component store is damaged too; run DISM, then sfc again |
| could not perform the requested operation | Try again from Safe Mode, or offline from the recovery environment |
Details are logged in C:\Windows\Logs\CBS\CBS.log. Lines tagged [SR] are the ones sfc wrote.
sfc and DISM together
sfc can only repair from the component store. If the store itself is corrupt, sfc cannot finish, and DISM /Online /Cleanup-Image /RestoreHealth is the tool that repairs the store, using Windows Update or a supplied Windows image. Two orders are in common use. Many troubleshooting guides and exam questions run sfc first, bring in DISM only when sfc reports files it could not fix, then run sfc again. Microsoft's own support article runs DISM first and sfc second. Either way, when sfc says it could not repair some files, the next step is DISM, not a reinstall.
When to use it
- Built-in Windows tools or features stop opening or crash.
- Errors name a missing or damaged Windows file, often after a power loss or forced shutdown.
- Repeated crashes or blue screens with no obvious driver cause.
- Windows Update fails with corruption errors.
- Cleanup after malware that replaced or altered system files.
sfc does not fix file-system errors or bad sectors (use chkdsk), repair third-party applications or recover personal files. If sfc and DISM both fail, the next step up is a repair installation, which replaces every Windows file while keeping apps and data.
sfc on the CompTIA A+ exam
sfc is one of the command-line tools in Core 2 (220-1202) objective 1.5 and a standard fix for the Windows troubleshooting scenarios in objective 3.1. Know the exact syntax, sfc /scannow, that it needs an elevated prompt, what it repairs and what to do when it cannot. Cues: system files are corrupted or missing, think sfc /scannow; sfc could not repair everything, think DISM RestoreHealth, then sfc again; file-system errors or bad sectors, think chkdsk instead.