Click to Rate and Give Feedback
MSDN
MSDN Library
 System File Checker
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/2000:  Sets the file cache size. The default size of the cache is 0x32 (50 MB).
/CANCEL

This value is not supported.

Windows 2000:  Cancels all pending scans of protected system files.
/ENABLE

This value is not supported.

Windows 2000:  Enables WFP for standard operation.
/FILESONLY

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

Windows XP/2000:  Not supported.
/OFFBOOTDIR

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

Windows XP/2000:  Not supported.
/OFFWINDIR

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

Windows XP/2000:  Not supported.
/PURGECACHE

This value is not supported.

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

This value is not supported.

Windows 2000:  Replaces all incorrect file versions without prompting the user.
/REVERT

Return to default settings.

Windows Server 2008, Windows Vista, and Windows 2000:  Not supported.
/SCANBOOT

This value is not supported.

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

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

Windows XP/2000:  Not supported.
/SCANNOW

Scans all protected system files immediately.

/SCANONCE

This value is not supported.

Windows Server 2003 and Windows XP/2000:  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/2000:  Not supported.
/VERIFYONLY

Scans all protected system files but does not repair files.

Windows XP/2000:  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

Send comments about this topic to Microsoft

Build date: 2/7/2008

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker