System File Checker

The system file checker utility, Sfc.exe, allows administrators to scan all protected resources to verify their versions.

Files critical to restart Windows that do not match the expected Windows version may be replaced with the correct versions. If a file is repaired, the corresponding registry data is also repaired. Protected files not critical to restart Windows are not repaired.

Syntax

The following is the command-line syntax for Sfc.

SFC options [=full file path]

Options

/CACHESIZE=x

This value is not supported.

Windows Server 2003 and Windows XP: Sets the file cache size. The default size of the cache is 0x32 (50 MB).

/CANCEL

This value is not supported.

/ENABLE

This value is not supported.

/FILESONLY

Verify or repair only files. Do not verify or repair registry keys.

Windows XP: Not supported.

/OFFBOOTDIR

Use this option for offline repairs. Specify the location of the offline boot directory.

Windows XP: Not supported.

/OFFWINDIR

Use this option for offline repairs. Specify the location of the offline Windows directory.

Windows XP: Not supported.

/PURGECACHE

This value is not supported.

Windows Server 2003 and Windows XP: Empties the file cache and scans all protected system files.

/QUIET

This value is not supported.

/REVERT

Return to default settings.

Windows Server 2008 and Windows Vista: Not supported.

/SCANBOOT

This value is not supported.

Windows Server 2003 and Windows XP: Scans all protected system files at every boot.

/SCANFILE

Scans and repairs the file located at the specified full path.

Windows XP: Not supported.

/SCANNOW

Scans all protected system files immediately.

/SCANONCE

This value is not supported.

Windows Server 2003 and Windows XP: Scans all protected system files at the next boot.

/VERIFYFILE

Verifies the file at the specified full path. This option does not repair the file.

Windows XP: Not supported.

/VERIFYONLY

Scans all protected system files but does not repair files.

Windows XP: Not supported.

Sfc sets the following registry value:

= HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SFCScan

For more information, see WFP Registry Values.

Remarks

On Windows Vista only, you can set the WINDOWS_TRACING_LOGFILE environment variable to the location of a valid directory to receive a log file.

Examples

The following sample command lines are examples of sfc.exe syntax.

sfc /SCANNOW

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

sfc /SCANFILE=d:\windows\system32\kernel32.dll /OFFBOOTDIR=d:\ /OFFWINDIR=d:\windows

sfc /VERIFYONLY /FILESONLY