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:
- For more information about the sfc command on Windows Server 2003, see article 310747 in the Microsoft Knowledge Base.
- 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:
- RPC Server error is Unavailable in Windows Server 2008 R2
- Table summarizes the basic PowerShell commands
- Instructions for installing Windows Server 2012 step by step
- Install Windows Server 2008
You should read it
May be interested
- Instructions for using Command Promptdeep 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 Windowsthe rd command helps delete a directory
- Cmd command in Windowsthe 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 Promptcommand 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 Windowsto 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 Windowsthe fc command compares two files or a collection of files and displays the differences between them.
- The echo command in Windowsthe 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 Windowsthe 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 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 Windowsthe 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.