Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Windows Server 系統教學 >> Server 2003

刪除 Windows Server 2003 多餘的 wmpub 資料夾:替換 sfcfiles.dll 破解 WFP 保護

編輯:Server 2003

將 Windows Server 2003 當桌面作業系統使用時,系統磁碟根目錄下的 C:\wmpub 與 C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\ 等 IIS 相關資料夾顯得多餘且難以刪除,因受 Windows File Protection (WFP) 保護。本文提供經驗證可行的繞過方法:以 Windows XP Professional 同版本的 sfcfiles.dll 替換系統檔,暫時停用 WFP,即可順利刪除。

操作步驟

  1. 取得 Windows XP Professional(相同 Service Pack 版本) 的 sfcfiles.dll(位於 %windir%\system32\ 與 %windir%\system32\dllcache\)。
  2. 以管理員身分開啟命令提示字元,依序執行以下指令覆蓋系統檔(需先取得檔案擁有權與完全控制權限):
    takeown /f %windir%\system32\sfcfiles.dll
    icacls %windir%\system32\sfcfiles.dll /grant administrators:F
    copy /y "XP_sfcfiles.dll路徑" %windir%\system32\sfcfiles.dll
    
    takeown /f %windir%\system32\dllcache\sfcfiles.dll
    icacls %windir%\system32\dllcache\sfcfiles.dll /grant administrators:F
    copy /y "XP_sfcfiles.dll路徑" %windir%\system32\dllcache\sfcfiles.dll
    
  3. 重新開機。
  4. 開機後即可正常刪除 C:\wmpub\ 與 C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\ 等資料夾。

原理說明

sfcfiles.dll 是 WFP 核心元件,負責監控並還原受保護的系統檔案。XP 版本的 sfcfiles.dll 不認得 2003 的 IIS 資料夾為受保護對象,替換後 WFP 便不再攔截刪除動作。

風險與建議

  • 風險:替換核心系統檔可能導致系統不穩定、無法安裝修補程式、SFC 掃描失效。
  • 建議:僅在確定不再需要 IIS 功能、且接受潛在風險的測試/個人環境中使用。生產伺服器請改用「新增/移除 Windows 元件」正規移除 IIS,或直接隱藏資料夾(attrib +h +s)。
  • 還原:若出現問題,可從 %windir%\system32\dllcache\ 或原版 2003 安裝光碟 I386\SFCFILES.DL_(用 expand 解壓)還原原版 sfcfiles.dll。

此技巧屬「駭客式」系統調校,請權衡風險後謹慎操作,並務必先備份重要資料。

Copyright © Windows教程網 All Rights Reserved