Windows 2000 SP4 及數十個熱修補包手工安裝極其繁瑣。利用安裝程序內建的命令行參數,可實現全自動靜默批量打補丁。
| 補丁類型 | 無人值守參數 | 不重啟參數 | 查詢命令 |
|---|---|---|---|
| Service Pack (SP4) | /U | /Z 或 /N | SP4檔名 /? |
| 熱修補包 (KBxxxxxx) | /passive 或 /quiet | /norestart | KB檔名 /? |
D:\Patches)。D:\Patches\W2KSP4_ZH_CN.exe /U /Z D:\Patches\KB828035.exe /passive /norestart D:\Patches\KB828741.exe /passive /norestart D:\Patches\KB823980.exe /passive /norestart ...(其餘補丁)
InstallPatches.bat。/norestart / /Z 抑制單個補丁重啟,腳本末尾統一安排一次重啟(shutdown -r -t 60)。%SystemRoot%\ 下(如 KB828035.log),腳本可增加 >> D:\Patches\install.log 2>&1 統一收集。早期熱修補包不支持 /norestart 時,可使用微軟 QChain.exe 串聯多個補丁僅重啟一次。SP4 及較新補丁已原生支持,無需 QChain。
@echo off
echo === 正在安裝 SP4 ===
W2KSP4_ZH_CN.exe /U /Z
echo === 正在安裝熱修補包 ===
for %%f in (KB*.exe) do (
echo 安裝 %%f ...
%%f /passive /norestart
)
echo === 所有補丁安裝完成,60 秒後重啟 ===
shutdown -r -t 60 -c "補丁安裝完成,自動重啟"
pause
掌握 /U、/passive、/norestart 等核心參數,配合批處理腳本,可將 Windows 2000 數十個補丁的安裝時間從數小時壓縮至 20 分鐘內無人值守完成,極大提升運維效率。