系統文件檢查器

本页使用了标题或全文手工转换
维基百科,自由的百科全书
系統文件檢查器
内置于Windows 98及之后版本
类型系统软件
网站learn.microsoft.com/en-us/windows-server/administration/windows-commands/sfc 编辑维基数据

系统文件检查器Microsoft Windows中的一个实用工具,它允许用户扫描和恢复损坏的Windows系统文件。此实用工具在Windows 98Windows 2000Windows NT家族的所有后续版本中可用。在Windows VistaWindows 7中,系统文件检查器已与Windows资源保护集成,它可以保护注册表键、文件夹以及关键的系统文件。

Windows 2000/XP/2003的Windows文件保护(WFP)根据在Winlogon中注册文件更改通知来工作。如果检测到任何对受保护系统文件的修改,修改的文件会被恢复为位于压缩文件夹 %WinDir%\System32\dllcache 的缓存副本。Windows Vista引入的Windows资源保护(WRP)取代了Windows檔案保護,WRP基于对预定义的受保护资源设置自主访问控制列表(DACL)和存取控制串列(ACL)工作。完全访问和修改WRP保护的资源被限制到使用Windows模块安装服务(TrustedInstaller.exe)的进程。管理員使用者不再拥有对系统文件的完全访问权。

历史

由于在Windows 95中Windows应用程序可以覆盖系统文件,微软在那之后实施了大量安全措施以保护系统文件免遭恶意攻击、损坏或DLL地獄等问题。

系统文件检查器在Windows 98中首次引入为一个图形界面实用工具。它可以扫描和修复损坏的系统文件,方式是检查文件的版本号与Windows 98干净安装的原始版本号是否匹配。这种文件保护的方法是很基本的。它根据文件扩展名和文件路径判定系统文件。它能够从安装媒体或用户指定的源路径恢复文件。Windows 98不提供超过文件属性的实时文件保护;因此,它没有提供阻止或抗打击能力。

Windows 2000开始的所有基于Windows NT的操作系统都引入了实时文件保护,它被称为Windows文件保护(WFP)。[1]

此外,系统文件检查器工具(sfc.exe)被重新实现为一个与WFP集成的更具健壮性的命令行实用工具。不同于Windows 98的SFC工具,新的实用工具着重于使用“Windows文件保护”扫描受保护的系统文件,并允许立即、静默从DLL缓存文件夹或安装媒体恢复系统文件。

SFC没有出现在Windows Me[2],它被系统文件保护(SFP)取代。[3]类似WFP,SFP提供实时的保护。

问题

早于Service Pack 4的Windows 2000附带的“系统文件检查器”组件会覆盖微软发布的补丁;[4]这在Windows 2000 Service Pack 4中被纠正。

使用

在基于Windows NT的操作系统中,系统文件检查器可以通过命令提示字元以如下命令调用:

sfc /scannow  (to repair problems)

sfc /verifyonly (no repair)

如果它发现一个问题,它会尝试从DLL缓存(%WinDir%\System32\Dllcache\)替换有问题的文件。如果文件不在DLL缓存或者DLL缓存也已损坏,用户将被提示插入Windows安装媒体或提供网络安装路径。系统文件检查器会从注册表值 SourcePathServicePackSourcePath 检查Windows安装源路径。[5]如果用户提供的安装媒体值不正确,它可能会再次提示要求输入。[6]

从Windows Vista开始,文件受存取控制串列(ACL)保护,不过上面的命令并未改变。

在Windows Vista和之后Windows操作系统中的系统文件检查器可以扫描指定文件。另外,扫描可以对一个脱机Windows安装文件夹执行以替换损坏的文件,应对该Windows已无法启动的情况。当执行脱机扫描时,系统文件检查器必须从另一个Windows Vista或更新版本操作系统的工作目录运行,或者从可以访问Windows恢复环境的Windows安装DVD运行。

在组件存储已损坏情况下,“系统更新准备工具”(CheckSUR)可以在Windows 7、Windows Vista、Windows Server 2008 R2或Windows Server 2008上安装,这在Windows 10、Windows 8.1、Windows 8、Windows Server 2012 R2或Windows Server 2012中已被「部署映像服务和管理工具」(DISM)取代。此工具将检查违反自身有效载荷的情况并修复损坏。[7]

参考资料

  1. ^ Description of the Windows File Protection Feature. Help and Support. Microsoft. 2003-12-15 [2006-08-28]. (原始内容存档于2004-10-20). 
  2. ^ Spector, Lincoln. Answer Line: Windows 98 Utilities Missing in Windows Me?. PC World. IDG. 2001-02-14 [2011-12-26]. (原始内容存档于2011-06-05). 
  3. ^ System File Protection and Windows Me. Microsoft. 2001-12-04 [2006-08-28]. (原始内容存档于2004-06-22). 
  4. ^ The SFC /SCANNOW Command May Overwrite Hotfix Files. Microsoft Support website. Microsoft Corporation. 30 October 2006 [1 February 2010]. (原始内容存档于2006-11-16). 
  5. ^ System File Checker does not accept a network location that contains the installer CD when you use the scannow switch in Windows XP SP2 or in Windows Server 2003. [2016-06-13]. (原始内容存档于2007-01-16). 
  6. ^ You are prompted to insert a Windows XP SP2 CD when you try to run the System File Checker tool on a Windows XP SP2-based computer. [2016-06-13]. (原始内容存档于2007-02-07). 
  7. ^ Fix Windows Update errors by using the DISM or System Update Readiness tool. Microsoft. 21 December 2015 [10 May 2016]. (原始内容存档于2016-04-29). 

外部链接