sfc.exe

0
106
sfc.exe

Here we can see, “sfc.exe”

The sfc.exe application checks the integrity of all system files protected by Windows File Protection (WFP) and can replace erroneous versions with Microsoft ones if necessary. The user must have administrator credentials to launch the software.

Synopsis

The use of brackets [] to surround arguments is optional.

sfc [/scannow] [/verifyonly] [/scanfile=<filePath>] [/verifyfile=<filePath>]
    [/offbootdir=<bootDriveLetter>] [/offwindir=<windowsDriveLetter>] 
    [/scanonce] [/scanboot] [/revert] [/purgecache] [/cachesize=x]

Description

The sfc utility has several flags, the most common of which is /scannow. Although not all flags and parameters are supported on all operating systems, the tool can be executed on any Windows PC and through the Windows recovery console. A list of platform-supported flags can be found in the “Compatibility” section below.

Also See:  The Uncharted: Legacy of Thieves Collection could be released sooner than expected

The possibilities are as follows:

/?

Displays a list of flags that are currently active.

/scannow

After running the command, it checks the integrity of all protected system files and repairs those that are corrupted or modified. Those files had their default values restored.

/verifyonly

After running the command, it checks the integrity of all protected system files but does not repair them.

/scanfile=<filePath>

Scans a file’s integrity using its absolute path (filePath) and restores it if any modifications are found. c:windowssystem32example.dll is an example filePath.

/verifyfile=<filePath>

Scans but does not fix the integrity of a file supplied by its absolute path (FilePath). c:\windows\system32\example.dll is an example filePath.

/offwindir=<windowsDriveLetter>

Used in conjunction with /offbootdir to indicate the drive on which Windows is installed to update its system files.

/offbootdir=<bootDriveLetter>

The /offbootdir=<bootDriveLetter> specifies the letter associated with the drive that needs to be repaired. It’s used with /offwindir=<windowsDriveLetter>. Here is an example of how these two commands are used in the Windows Recovery Console.
sfc /scannow /offbootdir=d:\ /offwindir=d:\windows
It scans and repairs the files specified by the offwindir flag using the original Microsoft files found on offbootdir path.

It uses the original Microsoft files discovered on the offbootdir path to scan and fix the files indicated by the offwindir flag.

/scanonce

Scan and repair protected files the next time Windows starts up.

/scanboot

Every time Windows starts up, it scans and restores the protected files.

/revert

This command is used to cancel commands that have already been executed. For example, if the user used the /scanboot command to run a scan every time Windows starts up, using the /revert command will disable it.

/purgecache

Deletes files from the Windows cache folder, which is where the original system files are stored after they are updated. This command should be used with caution because it can cause system failures. The program also scans and copies current system files to the cache folder.

/cachesize=x

Changes the cache size to meet the needs of the user. Some megabytes is supplied as the x parameter.

Also See:  How to: Fix Windows 10 Update Error 0x800705b3

Exit Status

sfc.exe returns 0 if it succeeds and 1 if it fails.

Examples

To scan and repair corrupted system files as soon as possible:

sfc /scannow

To check the integrity of a sample file without restoring it, do the following:

sfc /verifyfile=c:\windows\system32\example.dll

The Windows installation disc on drive f: scan and repair an example file from the Windows Recovery Console.

sfc /scanfile=d:\windows\system32\example.dll /offbootdir=f:\ /offwindir=d:\windows

Compatibility

The sfc.exe program is compatible with Windows Vista and subsequent versions of Windows.

History

Windows Vista introduced the verify only, scanfile, verifyfile, offbootdir, and offwindir options.

Conclusion

I hope you found this information helpful. Please fill out the form below if you have any questions or comments.

User Questions

1. What is the purpose of SFC EXE?

SFC (System File Checker) is a standard tool with all contemporary versions of Windows. You can use this program to repair corrupt system files in Windows. System File Checker (SFC) can run as an administrator from Windows or the Windows recovery disk.

2. What’s the difference between chkdsk and SFC?

SFC (System File Checker) examines and repairs Windows system files, whereas CHKDSK discovers and fixes faults in the file system of your hard drive. When SFC detects that a file has been corrupted or updated, it automatically replaces it with the right version.

3. Is it necessary to run sfc regularly?

SFC is used to tell you whether you have any corrupted or modified system files, in addition to the system files not operating or giving you an error. While running SFC whenever you want isn’t a bad idea, it’s normally only used when you suspect you have corrupted or updated system files.

Also See:  NTLDR: Fatal error reading boot.ini: Fix for Windows XP

4. sfc scannow is NOT a reliable tool to detect file corruptions

sfc scannow is NOT a reliable tool to detect file corruptions from Amd

5. SFC /scannow and other “when things are not working right” fixes

SFC /scannow and other "when things are not working right" fixes from sysadmin