sfc
嚯嚯 发表于 2020-06-28 16:01浏览次数:
SFC扫描和替换正确版本的任何Microsoft Windows的文件的命令,简称系统文件检查器。当您遇到难以解决的问题时,sfc命令可能非常有用。
Short for System File Checker, SFC is a command that scans and replaces any Microsoft Windows file with the correct version. The sfc command can be great when you are running into an issue that is difficult to troubleshoot.
目录:
1 sfc 运行系统环境
2 sfc 语法
3 sfc 示例
sfc 运行系统环境
Windows xp
Windows vista
Windows 7
Windows 8
Windows 10
sfc 语法
Microsoft Windows Vista 及更高版本的语法
SFC [/SCANNOW] [/VERIFYONLY] [/SCANFILE=] [/VERIFYFILE=] [/OFFWINDIR=/OFFBOOTDIR=]
/SCANNOW
|
扫描所有受保护系统文件的完整性并修复有问题的文件。
|
/VERIFYONLY
|
扫描所有受保护系统文件的完整性。不执行维修操作。
|
/SCANFILE
|
扫描引用文件的完整性,如果发现问题,则修复文件。指定完整路径。
|
/VERIFYFILE
|
使用完整路径验证文件的完整性。不执行维修操作。
|
/OFFBOOTDIR
|
对于脱机修复,请指定脱机启动目录的位置。
|
/OFFWINDIR
|
对于脱机修复,请指定脱机Windows目录的位置。
|
Microsoft Windows XP 语法
SFC [/SCANNOW] [/SCANONCE] [/SCANBOOT] [/REVERT] [/PURGECACHE] [/CACHESIZE=x]
/SCANNOW
|
立即扫描所有受保护的系统文件。
|
/SCANONCE
|
在下次启动时扫描所有受保护的系统文件。
|
/SCANBOOT
|
每次引导时扫描所有受保护的系统文件。
|
/REVERT
|
将扫描恢复为默认设置。
|
/PURGECACHE
|
清除文件缓存。
|
/CACHESIZE=x
|
设置文件缓存大小。
|
Microsoft Windows 2000 语法
SFC [/SCANNOW] [/SCANONCE] [/SCANBOOT] [/CANCEL] [/ENABLE] [/PURGECACHE] [/CACHE SIZE=x] [/QUIET]
/SCANNOW
|
立即扫描所有受保护的系统文件。
|
/SCANONCE
|
在下次启动时扫描所有受保护的系统文件。
|
/SCANBOOT
|
每次引导时扫描所有受保护的系统文件。
|
/CANCEL
|
取消所有未完成的受保护系统文件扫描。
|
/QUIET
|
替换所有不正确的文件版本,而不提示用户。
|
/ENABLE
|
为正常操作启用Windows文件保护。
|
/PURGECACHE
|
清除文件缓存并立即扫描所有受保护的系统文件。
|
/CACHESIZE=x
|
设置文件缓存大小。
|
Microsoft Windows Vista and later syntax
SFC [/SCANNOW] [/VERIFYONLY] [/SCANFILE=] [/VERIFYFILE=] [/OFFWINDIR=/OFFBOOTDIR=]
/SCANNOW
|
Scans integrity of all protected system files and repairs files with problems.
|
/VERIFYONLY
|
Scans integrity of all protected system files. No repair operation is performed.
|
/SCANFILE
|
Scans integrity of the referenced file, and then repairs file if problems are identified. Specify full path.
|
/VERIFYFILE
|
Verifies the integrity of the file with full path. No repair operation is performed.
|
/OFFBOOTDIR
|
For offline repair, specify the location of the offline boot directory.
|
/OFFWINDIR
|
For offline repair, specify the location of the offline Windows directory.
|
Microsoft Windows XP syntax
SFC [/SCANNOW] [/SCANONCE] [/SCANBOOT] [/REVERT] [/PURGECACHE] [/CACHESIZE=x]
/SCANNOW
|
Scans all protected system files immediately.
|
/SCANONCE
|
Scans all protected system files on the next boot.
|
/SCANBOOT
|
Scans all protected system files on every boot.
|
/REVERT
|
Return scan to its default settings.
|
/PURGECACHE
|
Purges the file cache.
|
/CACHESIZE=x
|
Sets the file cache size.
|
Microsoft Windows 2000 syntax
SFC [/SCANNOW] [/SCANONCE] [/SCANBOOT] [/CANCEL] [/ENABLE] [/PURGECACHE] [/CACHE SIZE=x] [/QUIET]
/SCANNOW
|
Scans all protected system files immediately.
|
/SCANONCE
|
Scans all protected system files on the next boot.
|
/SCANBOOT
|
Scans all protected system files on every boot.
|
/CANCEL
|
Cancels all the pending scans of protected system files.
|
/QUIET
|
Replaces all the incorrect file versions without prompting the user.
|
/ENABLE
|
Enables Windows File Protection for normal operation.
|
/PURGECACHE
|
Purges the file cache and scans all protected system files immediately.
|
/CACHESIZE=x
|
Sets the file cache size
|
sfc 示例
sfc /scannow
开始扫描所有系统文件。
sfc /VERIFYFILE=c:\windows\system32\kernel32.dll
检查kernel32.dll文件是否存在任何问题。如果扫描文件没有发现问题,则“ Windows资源保护未发现任何完整性违规”。几秒钟后出现此消息。
sfc /scannow
Begins the scan of all system files.
sfc /VERIFYFILE=c:\windows\system32\kernel32.dll
Check the kernel32.dll file for any problems. If no problems are found with the file scanned a "Windows resource protection did not find any integrity violations." message appears after a few seconds.
在Windows Vista,Windows 7,Windows 8和Windows 10中,必须在管理员的命令模式下运行,SFC命令才能正常工作。否则,您将收到“您必须是运行控制台会话的管理员才能使用sfc实用程序”。尝试运行以下任何示例时出现错误。
In Windows Vista, Windows 7, Windows 8, and Windows 10 you must be running in an elevated command mode for the SFC command to work properly. Otherwise, you'll receive the "You must be an administrator running a console session to use the sfc utility." error when you attempt to run any of the following examples.