SFC (System File Checker) Command Explained

Photo of author

By Victor Ashiedu

Published

Do you want to learn the SFC (System File Checker) command beyond its popular /scannow parameter? This guide is a deep dive into the SFC command with examples.

Overview

With your PC exposed to viruses and malware, sometimes, some Windows system files may be corrupt. Additionally, the files may even be replaced with incorrect, non-Microsoft versions.

The SFC scans your PC and detects if any of the protected Windows files are corrupt. Then, if it determines that a protected Windows file is corrupted or overwritten, it replaces the incorrect versions with the correct Microsoft versions.

Specifically, when you run SFC with the /scannow parameter, SFC scans all protected system files. Then, if it finds a corrupted system or one with the wrong version, it replaces corrupted files with a cached copy.

Cached copies of Windows system files are located in a compressed folder, %WinDir%\System32\dllcache.

Before I proceed, it is important to mention that you need to run the command prompt as administrator to run the SFC command.

Finally, most times, before you run SFC with the /scannow parameter, it is recommended to run – DISM.exe /Online /Cleanup-Image /RestoreHealth – first. More on this is in the examples section of this guide.

Syntax And Parameters of the System File Checker Command

The syntax of the SFC (System File Checker) command is:

SFC [/SCANNOW] [/VERIFYONLY] [/SCANFILE=<file>] [/VERIFYFILE=<file>] [/OFFWINDIR=<offline windows directory> /OFFBOOTDIR=<offline boot directory> [/OFFLOGFILE=<log file path>]]

In the table below, I have explained each parameter and switch included in the command syntax above.

Parameter NameSFC Parameter Meaning/Notes
SCANNOWThis is the most popular parameter of the SFC (System File Checker) command. When you run SFC with the /Scannow parameter, it scans the integrity of all protected system files and repairs files with problems when possible.
VERIFYONLYThe VERIFYONLY parameter scans the integrity of all protected system files, but it does not repair the files.
VERIFYFILE=<file>This parameter verifies the integrity of the file with the full path to the file. When you use the VERIFYFILE=<file> parameter, it does not perform any repair operation.
SCANFILE=<file>Unlike the VERIFYFILE=<file>, the SCANFILE=<file> parameter scans the integrity of the specified file, then repairs the file if it identifies problems with the file.
OFFWINDIR=<offline windows directory> If you want to perform an offline repair, use the OFFWINDIR parameter to specify the location of the offline windows directory.
OFFBOOTDIR=<offline boot directory>You can also use this parameter to perform an offline Windows systems files repaid. Use the OFFBOOTDIR parameter to specify the location of the offline boot directory.
OFFLOGFILE=<log file path>Like the last two parameters, OFFLOGFILE is also for performing an offline repair. Use this parameter to enable logging optionally by specifying a log file path.
/?Run the SFC /? command to display SFC help at the command prompt.

Some SFC Command Examples

Now that you know a bit about the SFC (System File Checker) command, it is time to dive into some examples. In this section, I’ll show you other ways to run the System File Checker command beyond using its SCANNOW parameter.

Example 1: Run SFC /SCANNOW System File Checker Command

Having read this guide to this point, I suspect that you know how to run the SFC /SCANNOW. However, for any of my readers that require me to show how to do it expressly, here are the steps.

  1. Run command prompt as administrator.
  2. Then, when the command prompt opens with administrator privileges, run the SFC /SCANNOW command.

The SFC command with its /SCANNOW parameter takes a while to run. When it completes, it may return one of the following results:

  1. Windows Resource Protection did not find any integrity violations. This result means that your PC does not have any missing or corrupted system files.
  2. Windows Resource Protection could not perform the requested operation. My 4th example below shows the steps to fix this problem.
  3. Windows Resource Protection found corrupt files and successfully repaired them. This message will usually be followed by “Details are included in the CBS.Log %WinDir%\Logs\CBS\CBS.log.”
  4. Windows Resource Protection found corrupt files but was unable to fix some of them. This is also followed by “Details are included in the CBS.Log %WinDir%\Logs\CBS\CBS.log.”

    I will show how to fix this problem in my fifth example below.

Example 2: Use SFC and DISM Commands to Repair Corrupt Windows Files

I hinted earlier in this guide that it is common to run SFC and DISM commands to repair most system file corruption issues in Windows.

However, most users wonder which of the commands you run first. In addition to that, people wonder about which parameters of the SFC and DISM command to use.

This Microsoft guide recommends running DISM first before running the SFC command. Specifically, you need to run DISM with its “/Online /Cleanup-Image /RestoreHealth” parameters.

Then, run the SFC command with its SCANNOW parameter.

Example 3: Run SFC Scan as an Administrator

I have answered this question in my previous examples, but since people are asking this question, I wanted to address it directly.

The convention method to run SFC scab as administrator is first to run command prompt as administrator. Then, run the SFC command in the command prompt you opened with administrator privileges.

However, you can use PowerShell to run SFC as an administrator using the Start-Process command. Here is a command that runs SFC as administrator from PowerShell.

Start-Process -FilePath "SFC.exe" -ArgumentList @("/SCANNOW") -Verb RunAs

When you run the command, Windows will display the User Account Control prompt requesting you to allow the cmd app to make changes to your PC. Click Yes.

When you click Yes, PowerShell will open an instance of CMD and run the SFC command. After running the command, the SFC window will close automatically.

Example 4: Repair a Windows System File with SFC

Apart from finding and repairing multiple protected Windows system files, SFC can only repair one system file.

To repair one protected system file with the SFC command, use its SCANFILE=<file> parameter. For example, to scan and repair kernel32.dll, run the command below.

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

Example 5: Fix “Windows Resource Protection could not perform the requested operation” SFC Error

If your SFC /SCANNOW command returns the “Windows Resource Protection could not perform the requested operation” error message, follow the steps below to fix the problem:

  1. Boot your Windows 10 or Windows 11 PC to safe mode.
  2. Then, check that the folder – %WinDir%\WinSxS\Temp – has the PendingDeletes and PendingRenames folders.
  3. Start your PC in normal mode and run SFC /SCANNOW again.

Example 6: Fix “Windows Resource Protection found corrupt files but was unable to fix some of them” SFC Error

To fix this problem, you need to repair the corrupted files manually. Follow the steps below to complete this task:

  1. View details of the System File Checker process to find the corrupted file.
  2. Then manually replace the corrupted file with a known good copy of the file.

The two links above reference a Microsoft article.

Example 7: Fix SFC Command if it is Stuck

Sometimes when you run SFC /SCANNOW, it may get stuck. Follow the steps below to fix this problem:

  1. Close the stuck SFC command by pressing the ctrl and x keys simultaneously.
  2. Then, run the following DISM commands one after the other.
Dism.exe /online /cleanup-image /scanhealth
Dism.exe /online /cleanup-image /restorehealth

After running the two DISM commands, run SFC /SCANNOW again. If it still gets stuck, try the following steps:

  1. Run the CHKDSK command on drive C:\, then specify the /F switch.
CHKDSK C:/f

When you run the command, Windows will ask you to restart the computer to run the command. Enter Y and press the enter key to restart your PC.

  1. Then, when your PC has finished running the CHKDSK command and starts your computer, log in to your PC and run the SFC /SCANNOW command again.

Frequently Asked Questions

1. What is the System File Checker command?

The System File Checker (SFC.exe) command scans the protected Windows Operating System files and repairs them. SFC behaves this way if you run it with its SCANNOW parameter.

However, you can get the SFC command to behave differently by using other parameters.

2. How do I run DISM or SFC scan?

Before you can run DISM or SFC command, you must open a command prompt as administrator. Then, run the two commands as shown below.

DISM.exe /Online /Cleanup-Image /Restorehealth
SFC.exe /SCANNOW

Wait for the DISM command to complete before running the SFC command.

3. Should I run DISM or SFC first?

I recommend you run DISM, then the SFC command.

4. Does SFC Scannow remove viruses?

No, the SFC Scannow command does not remove viruses. However, if a virus replaces protected Windows system files, SFC may be able to replace the corrupted files with the correct versions.

5. Which is better, SFC Scannow or CHKDSK?

SFC is not better than CHKDSK, and vice versa. The two commands perform different functions.

Essentially, you run SFC if you suspect that your Windows OS has some corrupt protected files. SFC scans and replaces corrupted protected systems files if you run it with the SCANNOW parameter.

On the other hand, the CHKDSK command checks your PC’s disk for errors and fixes disk errors.

However, if you run the SFC command and it gets stuck, it may be helpful to run the CHKDSK command on the system drive and specify the /F switch.

When the CHKDSK finishes, you can try running the SFC command.

Conclusion

The SFC (System File Checker) command is a common Windows OS command. However, beyond its SCANNOW parameter, most users do not know about the other parameters of this powerful command.

Apart from its SCANNOW parameter, the SFC command has 6 other parameters. In this guide, I have discussed these parameters in detail with examples.

I hope you found the guide helpful. If you found the guide helpful, click on “Yes” beside the “Was this page helpful” question below.

You may also express your thoughts and opinions by using the “Leave a Comment” form at the bottom of this page.

Finally, to broaden your Windows command prompt commands knowledge, visit our Windows Command Prompt Guides page.

About the Author

Photo of author

Victor Ashiedu

Victor is the founder of InfoPress Media, publishers of Ilifeguides and Itechguides. With 20+ years of experience in IT infrastructure, his expertise spans Windows, Linux, and DevOps. Explore his contributions on Itechguides.com for insightful how-to guides and product reviews.

Related Articles

Get in Touch

We're committed to writing accurate content that informs and educates. To learn more, read our Content Writing Policy, Content Review Policy, Anti-plagiarism Policy, and About Us.

However, if this content does not meet your expectations, kindly reach out to us through one of the following means:

  1. Respond to "Was this page helpful?" above
  2. Leave a comment with the "Leave a Comment" form below
  3. Email us at [email protected] or via the Contact Us page.

Leave a comment

Send this to a friend