Use SFC / Scannow to repair Windows system files

Use SFC / Scannow to repair Windows system files

The sfc / scannow command is one of several specific options available in the sfc command, the command prompt utility that invokes the System File Checker.

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

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

How to use SFC / Scannow

  1. Open Command Prompt as administrator, very often referred to as an “elevated” command prompt.

    For the sfc / scannow command to work properly, it must be run from an elevated Command Prompt window in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista.

  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 via advanced boot options or system recovery options, see the section Running SFC / SCANNOW from outside Windows for some necessary changes to how the command is run.

    System File Checker will now check the integrity of every protected operating system file on your computer. It may take some time to finish.

    When the verification process is complete, you will see something like this in the Command Prompt window, assuming the problems have been found and fixed:

    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 that, 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 to access the original Windows installation CD or DVD at some point during this process.

  3. Restart your computer if sfc / scannow has repaired the files. System File Checker may or may not prompt you to reboot, but even if it doesn’t, you’ll still need to reboot.

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

How to interpret the CBS.log file

Each time the System File Checker is run, a LOG file is created that lists each file that has been checked and each repair operation completed.

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

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

This file could be useful for advanced troubleshooting or as a resource for a technical support person who could help you.

Running SFC / SCANNOW from outside of Windows

When running sfc / scannow from outside of Windows, such as from the command prompt available when booting from the Windows installation disc or flash drive, or from the system repair disc or recovery drive, you need to tell the sfc command exactly where Windows exists.

Here is an example:

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

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

Depending on how your computer is configured, Command Prompt, when used from outside Windows, doesn’t always assign drive letters the same way you see them inside Windows. In other words, Windows may be in C: \ Windows when you use it, but in 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 be sure, look for the drive with the Users folder on it, which will be the drive Windows is installed on, unless you have multiple installations of Windows on multiple drives.

Similar Posts

Leave a Reply

Your email address will not be published.