sfc command (Windows / CMD)
What it does
Verify protected Windows system files and repair supported corruption. Searches for the sfc command cmd system files usually need CMD syntax, practical switches, and notes on how it compares with PowerShell or Linux alternatives. This page covers syntax, common options, and copyable examples for Command Prompt.
Verify protected Windows system files and repair supported corruption.
Syntax
sfc [/SCANNOW] [/VERIFYONLY] [/SCANFILE=file] [/VERIFYFILE=file] [/OFFWINDIR=dir /OFFBOOTDIR=dir]
Common options
| Flag / option | Meaning |
|---|---|
| /SCANNOW | Scan and repair protected system files. |
| /VERIFYONLY | Scan without repairs. |
| /SCANFILE=file | Scan and repair one protected file. |
| /VERIFYFILE=file | Verify one file without repair. |
Practical examples
Repair scan
sfc /scannow
Scans and repairs supported corruption as administrator.
Verify only
sfc /verifyonly
Checks protected files without changes.
Offline scan
sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows
Scans an offline Windows installation.
Common mistakes
- Running repair operations without an elevated Command Prompt.
- Interrupting a scan because progress appears paused.
Related commands
- chkdskCheck a volume's filesystem and optionally repair logical or physical errors.
- systeminfoDisplay detailed operating system, hardware, boot, memory, and update information.
- shutdownShut down, restart, sign out, or schedule power actions.
- systemctlControl and inspect services and other systemd units.
- Get-ServiceRetrieve service controller objects and current service states.
- exportMark shell variables for inheritance by child processes.
- setDisplay, create, or remove CMD environment variables.
- dateDisplay or format the system date and time.
FAQ
What does sfc do in Command Prompt?
Verify protected Windows system files and repair supported corruption.
How do I run sfc in CMD?
Open Command Prompt and follow `sfc [/SCANNOW] [/VERIFYONLY] [/SCANFILE=file] [/VERIFYFILE=file] [/OFFWINDIR=dir /OFFBOOTDIR=dir]`; quote paths containing spaces.
What is a practical sfc example in CMD?
Try `sfc /scannow` — Scans and repairs supported corruption as administrator.
Can sfc be used in a batch file?
Yes. Check its exit code and escape CMD metacharacters when input is variable.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.