回應檔案概觀Answer Files Overview

回應檔案是以 XML 為基礎的檔案,包含在 Windows 安裝期間要使用的設定定義與值。An answer file is an XML-based file that contains setting definitions and values to use during Windows Setup. 在回應檔案中,您可以指定不同的安裝選項。In an answer file, you specify various setup options. 這些選項包括如何分割磁片、要在哪裡尋找即將安裝的 Windows 映像,以及要套用的產品金鑰。These options include how to partition disks, where to find the Windows image that will be installed, and which product key to apply. 您也可以指定適用于 Windows 安裝的值,例如使用者帳戶和顯示設定的名稱。You can also specify values that apply to the Windows installation, such as names of user accounts and display settings. 安裝程式的回應檔案通常稱為 Unattend.xml。The answer file for Setup is typically called Unattend.xml.

在 Windows 系統映射管理員 (Windows SIM) 中建立的回應檔案會與特定的 Windows 映像相關聯。Answer files that are created in Windows System Image Manager (Windows SIM) are associated with a particular Windows image. 因此,您可以驗證回應檔案中的設定與 Windows 映像中的設定。You can therefore validate the settings in the answer file to the settings in the Windows image. 不過,因為任何回應檔案都可以用來安裝任何 Windows 映像,如果沒有 Windows 映像中元件的回應檔案有設定,則會忽略這些設定。However, because any answer file can be used to install any Windows image, if there are settings in the answer file for components that are not in the Windows image, those settings are ignored. 如需如何建立回應檔案的相關資訊,請參閱 撰寫回應檔案的最佳作法For information about how to create answer files, see Best Practices for Authoring Answer Files.

回應檔案的區段Sections of an Answer File

回應檔案中的設定會組織成兩個區段、元件和套件。Settings in an answer file are organized into two sections, components and packages.

元件Components

回應檔案的 [元件] 區段包含 Windows 安裝程式期間所套用的所有元件設定。The components section of an answer file contains all the component settings that are applied during Windows Setup. 元件會組織成各種設定階段: windowsPEofflineServicing一般化特殊化auditSystemauditUseroobeSystemComponents are organized into various configuration passes: windowsPE , offlineServicing , generalize , specialize , auditSystem , auditUser , and oobeSystem. 每個設定階段都代表不同的 Windows 安裝程式階段。Each configuration pass represents a different phase of Windows Setup. 您可以在一或多個階段套用設定。Settings can be applied during one or more passes. 如果設定可以套用至多個設定階段,您可以選取要套用設定的傳遞。If a setting can be applied in more than one configuration pass, you can select the pass in which to apply the setting.

如需有關可在回應檔案中設定之不同元件和設定的詳細資訊,請參閱 (unattend.xml) 的自動 Windows 安裝程式參考For more information about the different components and settings that you can configure in an answer file, see the Unattended Windows Setup Reference (unattend.chm).

PackagesPackages

Microsoft 會使用套件來散發軟體更新、service pack 和語言套件。Microsoft uses packages to distribute software updates, service packs, and language packs. 套件也可以包含 Windows 功能。Packages can also contain Windows features.

您可以設定要新增至 Windows 映像或從 Windows 映像移除的封裝。You can configure packages to be added to a Windows image or removed from a Windows image. 您也可以變更封裝中功能的設定。You can also change the settings for features in a package.

Windows Foundation 套件(包含在所有 Windows 用戶端和伺服器映射中)包含 Windows 功能。The Windows Foundation Package, included in all Windows client and server images, includes Windows features. 例如,Windows Media Player、遊戲和備份都是 Windows Foundation 套件中的所有 Windows 功能。For example, Windows Media Player, Games, and Backup are all Windows features in the Windows Foundation Package.

Windows 中的功能已啟用或停用。Features are either enabled or disabled in Windows. 如果啟用 Windows 功能,系統上的使用者可以使用該功能的資源、可執行檔和設定。If a Windows feature is enabled, the resources, executable files, and settings for that feature are available to users on the system. 如果停用 Windows 功能,則無法使用封裝資源,但不會從系統中移除這些資源。If a Windows feature is disabled, the package resources are not available, but the resources are not removed from the system.

有些 Windows 功能可能需要您安裝其他功能,才能啟用已安裝的 Windows 版本。Some Windows features may require that you install other features before you can enable the installed version of Windows. 您必須驗證回應檔案,並新增任何必要的套件。You must validate your answer file and add any required packages.

例如,您可以停用 Windows Media Player 功能,以防止終端使用者執行 Windows Media Player。For example, you can disable the Windows Media Player feature to prevent end users from running Windows Media Player. 不過,由於套件已停用,因此不會從 Windows 映像移除這些資源。However, because the package is disabled, those resources are not removed from the Windows image.

offlineServicing 設定階段期間,回應檔案中的套件會套用至 Windows 映像。Packages in an answer file are applied to the Windows image during the offlineServicing configuration pass. 您也可以使用部署映射服務與管理 (DISM) 將套件新增至離線 Windows 映像。You can also use Deployment Image Servicing and Management (DISM) to add packages to an offline Windows image.

建立或開啟回應檔案Create or Open an Answer File

Windows 系統映射管理員總覽主題Windows System Image Manager Overview Topics