系統檔案檢查器

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書
系統檔案檢查器
內建於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). 

外部連結[編輯]