雖然 IE11 已隨 Windows 8.1 Update 達到高相容性與安全性,但部分企業環境或開發測試仍需降級或移除 IE。微軟 MSDN 部落格曾發布純命令列卸載腳本,本文整理 IE9/10/11 三版本對應指令,並說明執行前提與潛在風險。
%WINDIR%\servicing\Packages 目錄。IE9:
FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*9.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart"
IE10:
FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*10.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart"
IE11:
FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*11.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart"
FORFILES 遍歷 servicing\Packages 目錄下符合版本號的 .mum 更新封裝清單,逐一呼叫 pkgmgr /up 移除對應元件,/quiet 靜默模式,/norestart 延遲重啟。指令會依相依關係自動移除 IE 核心、渲染引擎、管理單元等子套件。
結語:指令雖有效,但屬「核子選項」,非必要請勿輕易執行。IT之家 建議將此文作為備查知識庫,實際操作前務必評估影響範圍。