Skip to content

All About SFC Windows command

The Windows System File Checker (sfc) command is a built-in tool that allows users to scan and repair corrupted or missing system files. By running the sfc command in the Command Prompt, users can resolve issues that may be causing stability or performance problems on their computer. The sfc command works by comparing the current system files with the ones stored in the Windows component store and replacing any files that are corrupt or incorrect. This tool can be especially helpful in fixing issues related to system crashes, unexpected errors, or software malfunctions.

SFC Syntax:

Terminal window
sfc [/scannow] [/scanfile=<file>] [/verifyfile=<file>] [/verifyonly] [/offwindir=<offline target> /offbootdir=<offline target>]

Options:

OptionDescription
/scannowScans all protected system files immediately.
/scanfileScans the integrity of the specified file.
/verifyfileVerifies the integrity of the specified file.
/verifyonlyScans files and verifies their integrity.
/offwindirSpecifies the location of the Windows directory when the system is offline.
/offbootdirSpecifies the location of the boot directory when the system is offline.

Parameters:

ParameterDescription
fileSpecifies the file to be scanned or verified.
offline targetSpecifies the location when the system is offline.

SFC CMD Examples:

Check System Files

Terminal window
sfc /scannow

Scans and repairs corrupted system files on Windows.

Verify System Files without Repair

Terminal window
sfc /verifyonly

Verifies the integrity of system files without making any repairs.

Restore Default System Files

Terminal window
sfc /restorehealth

Repairs corrupt system files by fetching the correct versions from Windows Update.

Specify a Different Source

Terminal window
sfc /scannow /offbootdir=D:\ /offwindir=D:\Windows

Runs sfc with specified offline source directories.

Revert Pending Changes

Terminal window
sfc /scanfile=C:\Windows\System32\example.dll /revert

Reverts pending changes for a specific file.

Check System Files and Log to a File

Terminal window
sfc /scannow /offwindir=C:\Windows /offbootdir=C:\ /Log=C:\sfclog.txt

Scans and logs the results to a specified file.

SFC Command Help Center:

How do I use sfc in Windows?

To use the sfc command in Windows, execute the following command:

Terminal window
sfc --scannow

What is the purpose of the sfc command in Windows?

The sfc command in Windows is used to scan system files for integrity violations and repair corrupted or missing system files.

How can I repair system files using the sfc command?

To repair system files using the sfc command, run the following command:

Terminal window
sfc /scannow

How can I check the scan result after running sfc in Windows?

To check the scan result after running sfc in Windows, utilize the following command:

Terminal window
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log

Can I schedule a system file scan using the sfc command in Windows?

Yes, you can schedule a system file scan using the sfc command in Windows. Run the following command to schedule a scan:

Terminal window
sfc /scanfile=<file_path>

How do I specify a specific file to scan with the sfc command in Windows?

To specify a specific file to scan with the sfc command in Windows, execute the following command:

Terminal window
sfc /verifyfile=<file_path>

How can I extract specific information from the CBS.log file generated by sfc?

You can extract specific information from the CBS.log file generated by sfc using the following command:

Terminal window
findstr /c:"<search_keyword>" %windir%\Logs\CBS\CBS.log

What should I do if the sfc command is unable to repair some system files in Windows?

If the sfc command is unable to repair some system files in Windows, you can try using the Deployment Image Servicing and Management (DISM) tool to repair the Windows image.

Applications of the SFC Command

  • Scan for and restore corrupted system files
  • Verify the integrity of all protected system files
  • Repair problematic system files
  • Restore missing or damaged system files
  • Fix various Windows errors caused by corrupted files