MS-DOS and Windows command line sfc command

Updated: 05/21/2018 by Computer Hope
sfc command

Short for System File Checker, SFC is a command that scans and replaces any Microsoft Windows file with the correct version. The sfc command can be great when you are running into an issue that is difficult to troubleshoot.

Availability

Sfc command is an external command that is available for the following Microsoft operating systems as sfc.exe.

Sfc syntax

Microsoft Windows Vista and later syntax

SFC [/SCANNOW] [/VERIFYONLY] [/SCANFILE=<file>] [/VERIFYFILE=<file>]     [/OFFWINDIR=<offline windows directory> /OFFBOOTDIR=<offline boot directory> ]
/SCANNOW Scans integrity of all protected system files and repairs files with problems.
/VERIFYONLY Scans integrity of all protected system files. No repair operation is performed.
/SCANFILE Scans integrity of the referenced file, and then repairs file if problems are identified. Specify full path <file>.
/VERIFYFILE Verifies the integrity of the file with full path <file>. No repair operation is performed.
/OFFBOOTDIR For offline repair, specify the location of the offline boot directory.
/OFFWINDIR For offline repair, specify the location of the offline Windows directory.

Microsoft Windows XP syntax

SFC [/SCANNOW] [/SCANONCE] [/SCANBOOT] [/REVERT] [/PURGECACHE] [/CACHESIZE=x]
/SCANNOW Scans all protected system files immediately.
/SCANONCE Scans all protected system files on the next boot.
/SCANBOOT Scans all protected system files on every boot.
/REVERT Return scan to its default settings.
/PURGECACHE Purges the file cache.
/CACHESIZE=x Sets the file cache size.

Microsoft Windows 2000 syntax

SFC [/SCANNOW] [/SCANONCE] [/SCANBOOT] [/CANCEL] [/ENABLE] [/PURGECACHE] [/CACHE SIZE=x] [/QUIET]
/SCANNOW Scans all protected system files immediately.
/SCANONCE Scans all protected system files on the next boot.
/SCANBOOT Scans all protected system files on every boot.
/CANCEL Cancels all the pending scans of protected system files.
/QUIET Replaces all the incorrect file versions without prompting the user.
/ENABLE Enables Windows File Protection for normal operation.
/PURGECACHE Purges the file cache and scans all protected system files immediately.
/CACHESIZE=x Sets the file cache size

Sfc examples

Note

In Windows Vista, Windows 7, Windows 8, and Windows 10 you must be running in an elevated command mode for the SFC command to work properly. Otherwise, you'll receive the "You must be an administrator running a console session to use the sfc utility." error when you attempt to run any of the following examples.

sfc /scannow

Begins the scan of all system files.

sfc /VERIFYFILE=c:\windows\system32\kernel32.dll

Check the kernel32.dll file for any problems. If no problems are found with the file scanned a "Windows resource protection did not find any integrity violations." message will appear after a few seconds.