Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

IIS 重裝不求人:5 步驟徹底清除殘留檔案與註冊表

編輯:系統常見問題解答

控制台「新增/移除程式」移除 IIS 常遺留 metabase、登錄表、檔案殘骸,導致重裝後錯誤依舊。標準乾淨重裝 SOP:

  1. 移除 IIS:控制台 → 程式集 → 開啟或關閉 Windows 功能 → 取消勾選「Internet Information Services」→ 確定完成移除。
  2. 刪除系統資料夾(建議進安全模式操作,避免檔案鎖定):
    %windir%\system32\inetsrv
    %windir%\iisX.log (X 為版本號,如 iis7.log)
    %windir%\system32\inetsrv\metaback (舊版 metabase 備份)
  3. 刪除網站根目錄:\inetpub\ (含 wwwroot、ftproot、mailroot、scripts、adminscripts 等)。
    ⚠ 若有自訂網站路徑,同步手動刪除或備份後清空。
  4. 清理註冊表(謹慎操作,先匯出備份):
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IISADMIN
    刪除上述機碼及子機碼。
  5. 重新安裝 IIS:同步開啟所需角色服務(ASP.NET、CGI、URL Rewrite、Logging、Request Filtering 等)→ 完成後執行 iisreset 驗證。

驗證乾淨重裝成功

  • 瀏覽 https://localhost 顯示 IIS 預設首頁。
  • appcmd list sites 僅列出「Default Web Site」。
  • 事件檢視器 → Windows Logs → System 無 IIS 相關錯誤/警告。
  • 應用程式集區以 ApplicationPoolIdentity 啟動正常。

補充:匯出/匯入設定避免重新配置

重裝前:%windir%\system32\inetsrv\appcmd add backup "PreReinstallBackup"
重裝後:appcmd restore backup "PreReinstallBackup" (需同版本)。

遵循 5 步驟,IIS 重裝零殘留、零遺憾。

Copyright © Windows教程網 All Rights Reserved