Use SFC /Scannow to Repair Windows System Files

Open an elevated Command Prompt and enter sfc /scannow

What to Know

  • Open Command Prompt as an administrator and enter sfc /scannow.
  • Restart your computer if sfc /scannow repaired files.
  • Repeat whatever process caused your original problem to see if sfc /scannow resolved it.

This article explains how to use the sfc /scannow command to repair Windows system files. The instructions apply to Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista.

How to Use SFC /Scannow

Follow these steps to repair Windows system files with sfc /scannow:

  1. Open Command Prompt as an administrator, very often referred to as an "elevated" Command Prompt.

    For the sfc /scannow command to work properly, it must be executed from an elevated Command Prompt window.

  2. Type the following command and then press Enter.

    sfc /scannow
    
    Windows 10 Command Prompt showing "sfc /scannow"

    To use System File Checker from the Command Prompt through Advanced Startup Options or System Recovery Options, see the Executing SFC /SCANNOW From Outside of Windows section below for some necessary changes in how you execute the command.

    System File Checker will now verify the integrity of every protected operating system file on your computer. It might take a while to finish.

    When the verification process completes, you'll see something like this in the Command Prompt window, assuming problems were found and corrected:

    Windows Resource Protection found corrupt files and successfully repaired them. Details are included in the CBS.Log windir\Logs\CBS\CBS.log. For example C:\Windows\Logs\CBS\CBS.log. Note that logging is currently not supported in offline servicing scenarios.
    

    ...or something like this, if no problems were found:

    Windows Resource Protection did not find any integrity violations.
    

    In some situations, most often in Windows XP and Windows 2000, you may also need access to your original Windows installation CD or DVD at some point during this process.

  3. Restart your computer if sfc /scannow repaired files. System File Checker may or may not prompt you to restart but even if it doesn't, you should restart anyway.

  4. Repeat whatever process caused your original problem to see if sfc /scannow resolved it.

What Is SFC /Scannow?

The sfc /scannow command is one of the several specific switches available in the sfc command, the Command Prompt utility invoking System File Checker.

While there are plenty of different things you can do with the command, sfc /scannow is the most common way that the sfc command is used.

Sfc /scannow will inspect all of the important Windows files on your computer, including Windows DLL files. If System File Checker finds a problem with any of these protected files, it will replace it.

How to Interpret the CBS.log File

Every time you run System File Checker, a LOG file is created that itemizes every file that was checked and every repair operation that completed.

Assuming Windows is installed on the C: drive then the log file can be found here and opened with Notepad or some other text editor:

C:\Windows\Logs\CBS\CBS.log
A screenshot of a CBS log file that results from the System File Checker.

This file could be useful for advanced troubleshooting or as a resource for a tech support person that might be helping you out.

Executing SFC /Scannow From Outside of Windows

When running sfc /scannow from outside of Windows, like from the Command Prompt available when you boot from your Windows installation disc or flash drive, or from your System Repair Disc or Recovery Drive, you'll have to tell the sfc command exactly where Windows exists.

Here's an example:

sfc /scannow /offbootdir=d:\ /offwindir=d:\windows

The /offbootdir= option specifies the drive letter, while the /offwindir= option specifies the Windows path, again including the drive letter.

Depending on how your computer is configured, the Command Prompt, when used from outside of Windows, doesn't always assign drive letters in the same way that you see them from inside Windows. In other words, Windows might be at C:\Windows when you're using it, but D:\Windows from the Command Prompt in ASO or SRO.

In most installations of Windows 11, Windows 10, Windows 8, and Windows 7, C: usually becomes D: and in Windows Vista, C: is usually still C:. To check for sure, look for the drive with the Users folder on it—that will be the drive Windows is installed on, unless you have multiple installations of Windows on multiple drives. Browse for folders in Command Prompt with the dir command.

FAQ
  • How many times do I need to run the sfc/scannow command?

    You should only need to run sfc/scannow when you notice a problem. Running the command once should be sufficient.

  • What is CHKDSK vs SFC?

    Sfc /scannow scans your system files while the chkdsk command is used to check a specified disk and repair or recover data on the drive if necessary. Chkdsk also marks any damaged or malfunctioning sectors on the hard drive or disk and recovers any information still intact.

  • Should I run DISM or SFC first?

    Run sfc /scannow before you run the dism command. That way, the dism command can correct problems identified by sfc /scannow.

Was this page helpful?