The sfc command in Windows

(Applies to Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012)

The sfc command is responsible for scanning and verifying the integrity of all protected system files.As well as replacing incorrect file system versions with more accurate versions.To better understand how to use this command, see the example below.

Sfc command syntax

 sfc [/ scannow] [/ verifyonly] [/ scanfile =] [/ verifyfile =] [/ offwindir = / offbootdir =] 

Sfc command parameter

Parameters

Describe

/ scannow

Fully scan all protected system files, and fix problem files when possible.

/ verifyonly

Full scan of all protected system files.However, no corrective actions will be taken.

/ scanfile

Full scan of specified files and fix files if problems are found when possible.

 

Specify the full path and file name

/ verifyfile

Verify the integrity of the specified file.There will be no repairs done here.

/ offwindir

Specify the location of the offline windows directory to serve the offline repair process.

/ offbootdir

Specify the location of the folder to start offline

/?

Show help at thecommand prompt.

Sfc command comment

You must be logged on as a member of the Administrators group to run the sfc .exe executable file.

If the sfc command detects that a protected file has been overwritten, it will retrieve the correct version of the file from the systemrootsystem32dllcache folder, then replace the file incorrectly.

There are functional differences between the sfc command on Windows Server 2003, Windows Server 2008 and Windows Server 2008 R2, to see what this difference is, refer to the following articles:

  1. For more information about the sfc command on Windows Server 2003, see article 310747 in the Microsoft Knowledge Base.
  2. For more information on sfc commands on Windows Server 2008 and Windows Server 2008 R2, see the article about System File Checker.

Example sfc command

To verify kernel32.dll, type:

 sfc /verifyfile=c:windowssystem32kernel32.dll 

To set up offline repair for kernel32.dll file with the offline boot directory set to d: and the offline windows directory set to d: windows, type:

sfc /scanfile=d:windowssystem32kernel32.dll / offbootdir = d: / offwindir = d: windows

See more:

  1. RPC Server error is Unavailable in Windows Server 2008 R2
  2. Table summarizes the basic PowerShell commands
  3. Instructions for installing Windows Server 2012 step by step
  4. Install Windows Server 2008
4.8 ★ | 4 Vote

May be interested

  • Instructions for using Command PromptInstructions for using Command Prompt
    deep in windows is a command-line world that is obscure. in this article, we will show you how to solve errors and make your computer more secure.
  • Rd command in WindowsRd command in Windows
    the rd command helps delete a directory
  • Cmd command in WindowsCmd command in Windows
    the cmd command starts a new version of the command interpreter, cmd.exe. if used without parameters, cmd will display copyright information and the version of the operating system.
  • How to use the command history function in Command PromptHow to use the command history function in Command Prompt
    command prompt is an extremely familiar command for anyone using windows operating system. besides, a lot of current software also supports the command line to perform actions on the command prompt window, instead of on the screen.
  • Reg command copy in WindowsReg command copy in Windows
    to copy an entry to the location specified on the local pc or the remote computer we will use the reg copy command. to learn more about how to use the reg copy command, you can track the syntax, explain the command parameters and the example tipsmake.com has compiled below.
  • Fc command in WindowsFc command in Windows
    the fc command compares two files or a collection of files and displays the differences between them.
  • The echo command in WindowsThe echo command in Windows
    the echo command displays the message or turns on / off the command repeat feature. if used without parameters, the echo command will display the current echo setting.
  • Xcopy command in WindowsXcopy command in Windows
    the xcopy command is a command prompt command used to copy one or more files or folders from one location to another. with many options and the ability to copy entire directories, the xcopy command is similar to, but much more powerful, than the copy command.
  • The cacls command in WindowsThe cacls command in Windows
    the cacls command displays or modifies an arbitrary access control list (dacl) on the specified file. the command applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012.
  • Clean command in WindowsClean command in Windows
    the clean command deletes all partitions or formats the volume from the current drive. the command applies to windows server (semi-annual channel), windows server 2019, windows server 2016, windows server 2012 r2, windows server 2012.