原始發佈日期: 2017 年 3 月 2 日
KB 識別碼:934307
簡介
本文將說明下列 Windows 作業系統中 Windows Update 獨立安裝程式 (Wusa.exe) :
-
Windows Vista
-
Windows Server 2008
-
Windows 7
-
Windows Server 2008 R2
-
Windows 8
-
Windows Server 2012
-
Windows 8.1
-
Windows Server 2012 R2
-
Windows 10
-
Windows Server 2016 Technical Preview
Wusa.exe 檔案位於 %windir%\System32 資料夾中。 Windows Update 獨立安裝程式會使用 Windows Update 代理程式 API 來安裝更新套件。 更新套件擴展名為 .msu。 .msu 擴展名與 Windows Update 獨立安裝程序相關聯。
更多資訊
.msu 檔案包含下列內容。
Content (內容) |
描述 |
Windows Update 元數據 |
說明 .msu 檔案包含的每一個更新套件。 |
一或多個 .cab 檔案 |
每個 .cab 檔案都代表一個更新。 |
.xml 檔案 |
此 .xml 檔案說明 .msu 更新套件。 Wusa.exe 使用封裝管理器工具 (Pkgmgr.exe) 執行自動安裝更新時,會使用 .xml 檔案。 例如,您下載 hotfix 934307。 Windows6.0-KB934307-x86.msu 檔案位於 C:\934307 資料夾中。 您可以在命令提示字元中輸入下列命令,將 .msu 檔案展開至暫存資料夾:expand -f:* “C:\934307\Windows6.0-KB934307-x86.msu” %TEMP% 然後,您在命令提示字元中輸入下列命令:pkgmgr.exe /n:%TEMP%\Windows6.0-KB934307-x86.xml |
屬性檔案 |
此檔案包含 Wusa.exe 使用的字串屬性。 例如,此檔案包含Microsoft知識庫中相關聯文章的標題。 |
當您使用 Wusa.exe 來安裝更新套件時,Wusa.exe 將 .msu 檔案的內容展開至臨時資料夾。 然後,Wusa.exe 執行下列步驟:
-
Wusa.exe 使用 .msu 檔案中的 Windows Update 元數據來搜尋適用的更新。
-
Wusa.exe 將適用更新的內容複製到 Windows Update 沙箱。 Windows Update 沙箱是受保護的資料夾。
-
Wusa.exe 會根據您啟動 Wusa.exe 的模式,呼叫 Windows Update 代理 API 中的適當函數。
-
當 Windows Update 精靈完成安裝時,Windows Update 代理程式 API 會傳回狀態。 然後,Wusa.exe 與 Windows Update 專員 API 同步運作。
注意.msu 更新套件中的每個更新都會在另一個會話中安裝。 當您使用 Wusa.exe 時,只會執行一個 Wusa.exe 實例。 Wusa.exe 不會變更 .msu 檔案中更新的內容。 Windows Update 基礎結構會根據更新的內容執行必要的動作。
當您以互動式模式啟動 Wusa.exe 時,歡迎畫面會顯示有關更新的高層級資訊。 如果您繼續安裝更新,Wusa.exe 會在 Windows Update Agent API 中呼叫適當的函數來啟動 Windows Update 精靈。 Windows Update 精靈會顯示Microsoft與更新套件相關聯的軟體授權條款。 Wusa.exe 呼叫 Windows Update 代理程式 API 以繼續安裝。 然後,Wusa.exe 等候 Windows Update 精靈完成安裝。 若要安裝 .msu 更新套件,請 Wusa.exe 檔案的完整路徑一起執行。 例如,如果 Windows6.0-KB934307-x86.msu 檔案位於 D:\934307 資料夾中,請在命令提示字元中輸入下列命令以安裝更新套件:wusa.exe d:\934307\Windows6.0-KB934307-x86.msu
您也可以按兩下 .msu 檔案來安裝更新套件。
您可以使用 Wusa.exe 卸載 Windows 7、Windows Server 2008 R2、Windows 8 和 Windows Server 2012 中的更新。 注意 您無法使用 Wusa.exe 卸載 Windows Vista 或 Windows Server 2008 中的更新。 您可以使用 Windows Defender 軟體總管手動卸載更新。 如需軟體總管的詳細資訊,請移至下列Microsoft網站:在 Windows Defender 中使用軟體總管 您可以將下列參數與 Wusa.exe 搭配使用。
參數 |
說明 |
/?, /h, /help |
檢視說明。 |
/quiet |
在安靜模式下執行 Wusa.exe 而不與用戶互動。 當工具以安靜模式執行時,它會在不與使用者互動的情況下執行。 如果需要,計算機會重新啟動。 例如,如果 Windows6.0-KB934307-x86.msu 檔案位於 D:\934307 資料夾中,請在命令提示字元中輸入下列命令,以在不與使用者互動的情況下安裝更新套件: wusa.exe d:\934307\Windows6.0-KB934307-x86.msu /quiet 注意 當您使用此參數時,Microsoft軟體授權條款不會顯示。 |
/norestart |
防止 Wusa.exe 重新啟動電腦。 如果 /quiet 開關不存在,則會忽略 /norestart 開關。 如果您使用這兩個切換來執行 Wusa.exe ,如果安裝需要重新啟動計算機,則必須在安裝完成後手動重新啟動操作系統。 例如,如果 Windows6.0-KB934307-x86.msu 檔案位於 D:\934307 資料夾中,請在命令提示字元中輸入下列命令以安裝更新套件: wusa.exe D:\934307\Windows6.0-KB934307-x86.msu /quiet /norestart |
/uninstall |
卸載指定的套件或 KB 編號。 |
/kb |
指定要使用其 KB 編號卸載的套件。 只能與 /uninstall 開關一起傳遞。 |
/extract |
Wusa.exe 將套件內容擷取到目的地資料夾。 |
/warnrestart |
當此參數與 /quiet 開關結合時, Wusa.exe 會在開始重新啟動安裝和卸載作業之前提示您。 |
/forcerestart |
當此參數與 /quiet 開關結合時, Wusa.exe 關閉應用程式,然後開始重新啟動。 |
注意.msu 檔案可以搭配 Windows 7 或 Windows 8 OEM 預安裝套件 (OPK) 或 Windows Automated Installation Kit (AIK) 使用 DISM.exe /Add-Package 選項來安裝至脫機映射。 如需詳細資訊,請移至下列Microsoft TechNet 網站:
操作系統套件服務 Command-Line 選項 若要檢視 Windows Update 獨立安裝程式事件記錄檔,請遵循下列步驟:
-
按兩下 [開始
],在 [開始搜尋] 方塊中輸入活動查看器,然後按兩下 [程式] 清單中的 [事件檢視器]。 在 Windows 8 和 Windows Server 2012 的 [開始] 畫面上,輸入活動查看器,按兩下 [設定],然後按兩下 [設定] 底下的 [檢視事件記錄檔]。 如果系統提示您輸入系統管理員密碼或進行確認,請輸入密碼,或按兩下 [ 繼續]。 -
在 事件檢視器 中,展開 [Windows 記錄],然後按兩下 [設定]。
設定事件會顯示在中間窗格中。 -
在 [ 動作] 窗格中,按兩下 [篩選目前的記錄]。
-
在 [ 事件來源] 清單中,按兩下以選取 [WUSA ] 複選框,然後按兩下 [ 確定]。