Share via


Windows Deployment sample answer files

You can use Windows answer files to modify Windows settings when you deploy new PCs.

The following sample answer files are used in the topics: Update Windows settings and scripts: Create your own answer file, Update drivers and packages: Intro to offline servicing, and Build to order: Use online servicing to make final updates to individual PCs. They can be downloaded from the OEM Partner Center.

To use these files, copy and paste them into a text editor such as Notepad, and save them by using the .xml filename that is shown in the comments.

Change Windows settings: create your own answer file

Use these answer files to automate a Windows installation.

These sample answer files are also included in the C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\Samples\Unattend folder together with the Windows ADK.

  • 64-bit UEFI:

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    
    <!-- Autounattend_x64-UEFI_sample.xml 
    
    This file automates the Windows installation. 
    
         Before using this file:
          * Replace ProductKey with a product key for the edition of Windows you are installing
            (example: Windows 8 Pro)
            Note:
               The product key used in Microsoft-Windows-Setup\UserData\ProductKey\Key 
               can be used many times in different installations and is not used to activate Windows. 
               It is only used to choose which edition of Windows to install. 
    
               The individual product key is either specified by the user, or by setting 
               Microsoft-Windows-Shell-Setup\ProductKey.
         * Set the default language to your own:
           Replace "en-US" with your language code in Microsoft-Windows-International-Core-WinPE\SetupUILanguage. 
           For a list of languages, see https://go.microsoft.com/fwlink/?LinkId=206620.
         * OEMs: Replace OEMInformation with your support information
    
         To use this file: 
            Save this file on the root of a USB flash drive with the filename: Autounattend.xml
            Put the Windows DVD and the USB key into a new x64-UEFI PC.
    -->
    
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <OEMInformation>
                    <Manufacturer>[ REPLACE WITH COMPANY NAME ]</Manufacturer>
                    <SupportURL>[ REPLACE WITH SUPPORT WEBSITE ]</SupportURL>
                </OEMInformation>
            </component>
        </settings>
        <settings pass="windowsPE">
            <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <SetupUILanguage>
                    <UILanguage>en-US</UILanguage>
                </SetupUILanguage>
                <InputLocale>en-US</InputLocale>
                <SystemLocale>en-US</SystemLocale>
                <UILanguage>en-US</UILanguage>
                <UserLocale>en-US</UserLocale>
            </component>
            <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    
                <DiskConfiguration>
                    <Disk wcm:action="add">
                        <CreatePartitions>
                            <!-- Windows RE Tools partition -->
                            <CreatePartition wcm:action="add">
                                <Order>1</Order>
                                <Size>300</Size>
                                <Type>Primary</Type>
                            </CreatePartition>
    
                            <!-- System partition (ESP) -->
                            <CreatePartition wcm:action="add">
                                <Order>2</Order>
                                <Size>100</Size>
                                <Type>EFI</Type>
                            </CreatePartition>
    
                            <!-- Microsoft reserved partition (MSR) -->
                            <CreatePartition wcm:action="add">
                                <Order>3</Order>
                                <Size>128</Size>
                                <Type>MSR</Type>
                            </CreatePartition>
    
                            <!-- Windows partition -->
                            <CreatePartition wcm:action="add">
                                <Order>4</Order>
                                <Extend>true</Extend> 
                                <Type>Primary</Type>
                            </CreatePartition>
                        </CreatePartitions>
    
                        <ModifyPartitions>
                            <!-- Windows RE Tools partition -->
                            <ModifyPartition wcm:action="add">
                                <Order>1</Order>
                                <PartitionID>1</PartitionID>
                                <Label>WINRE</Label>
                                <Format>NTFS</Format>
                                <TypeID>de94bba4-06d1-4d40-a16a-bfd50179d6ac</TypeID>
                            </ModifyPartition>
    
                            <!-- System partition (ESP) -->
                            <ModifyPartition wcm:action="add">
                                <Order>2</Order>
                                <PartitionID>2</PartitionID>
                                <Label>System</Label>
                                <Format>FAT32</Format>
                            </ModifyPartition>
    
                            <!-- Microsoft reserved partition (MSR) -->
                            <ModifyPartition wcm:action="add">
                                <Order>3</Order>
                                <PartitionID>3</PartitionID>
                            </ModifyPartition>
    
                            <!-- Windows partition -->
                            <ModifyPartition wcm:action="add">
                                <Order>4</Order>
                                <PartitionID>4</PartitionID>
                                <Label>Windows</Label>
                                <Format>NTFS</Format>
                            </ModifyPartition>
                        </ModifyPartitions>
                        <DiskID>0</DiskID>
                        <WillWipeDisk>true</WillWipeDisk>
                    </Disk>
                    <WillShowUI>OnError</WillShowUI>
                </DiskConfiguration>
                <ImageInstall>
                    <OSImage>
                        <InstallTo>
                            <DiskID>0</DiskID>
                            <PartitionID>4</PartitionID>
                        </InstallTo>
                    </OSImage>
                </ImageInstall>
                <UserData>
                    <ProductKey>
                        <WillShowUI>OnError</WillShowUI>
                        <Key>[ REPLACE WITH PRODUCT KEY ]</Key>
                    </ProductKey>
                    <AcceptEula>true</AcceptEula>
                </UserData>
            </component>
        </settings>
    </unattend>
    
  • 64-bit BIOS:

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    
    <!-- Autounattend_x64_BIOS_sample.xml 
    
    This file automates the Windows installation. 
    
         Before using this file:
          * Replace ProductKey with a product key for the edition of Windows you are installing
            (example: Windows 8 Pro)
            Note:
               The product key used in Microsoft-Windows-Setup\UserData\ProductKey\Key 
               can be used many times in different installations and is not used to activate Windows. 
               It is only used to choose which edition of Windows to install. 
    
               The individual product key is either specified by the user, or by setting 
               Microsoft-Windows-Shell-Setup\ProductKey.
         * Set the default language to your own:
           Replace "en-US" with your language code in Microsoft-Windows-International-Core-WinPE\SetupUILanguage. 
           For a list of languages, see https://go.microsoft.com/fwlink/?LinkId=206620.
         * OEMs: Replace OEMInformation with your support information
    
         To use this file: 
            Save this file on the root of a USB flash drive with the filename: Autounattend.xml
            Put the Windows DVD and the USB key into a new x64-BIOS PC.
    -->
    
    
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <OEMInformation>
                    <Manufacturer>[ REPLACE WITH COMPANY NAME ]</Manufacturer>
                    <SupportHours>[ REPLACE WITH SUPPORT HOURS ]</SupportHours>
                    <SupportPhone>[ REPLACE WITH SUPPORT PHONE ]</SupportPhone>
                    <SupportURL>[ REPLACE WITH SUPPORT WEBSITE ]</SupportURL>
                </OEMInformation>
            </component>
        </settings>
        <settings pass="windowsPE">
            <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <SetupUILanguage>
                    <UILanguage>en-US</UILanguage>
                </SetupUILanguage>
                <InputLocale>en-US</InputLocale>
                <SystemLocale>en-US</SystemLocale>
                <UILanguage>en-US</UILanguage>
                <UserLocale>en-US</UserLocale>
            </component>
            <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <DiskConfiguration>
                    <Disk wcm:action="add">
                        <CreatePartitions>
    
                            <!-- System partition -->
                            <CreatePartition wcm:action="add">
                                <Order>1</Order>
                                <Size>350</Size>
                                <Type>Primary</Type>
                            </CreatePartition>
    
                            <!-- Windows partition -->
                            <CreatePartition wcm:action="add">
                                <Order>2</Order>
                                <Extend>true</Extend> 
                                <Type>Primary</Type>
                            </CreatePartition>
                        </CreatePartitions>
    
                        <ModifyPartitions>
                            <ModifyPartition wcm:action="add">
                                <Order>1</Order>
                                <PartitionID>1</PartitionID>
                                <Label>System</Label>
                                <Format>NTFS</Format>
                                <Active>true</Active>
                            </ModifyPartition>
                            <ModifyPartition wcm:action="add">
                                <Order>2</Order>
                                <PartitionID>2</PartitionID>
                                <Format>NTFS</Format>
                                <Label>Windows</Label>
                            </ModifyPartition>
                        </ModifyPartitions>
                        <DiskID>0</DiskID>
                        <WillWipeDisk>true</WillWipeDisk>
                    </Disk>
                    <WillShowUI>OnError</WillShowUI>
                </DiskConfiguration>
                <ImageInstall>
                    <OSImage>
                        <InstallTo>
                            <DiskID>0</DiskID>
                            <PartitionID>2</PartitionID>
                        </InstallTo>
                    </OSImage>
                </ImageInstall>
                <UserData>
                    <ProductKey>
                        <WillShowUI>OnError</WillShowUI>
                        <Key>[ REPLACE WITH PRODUCT KEY ]</Key>
                    </ProductKey>
                    <AcceptEula>true</AcceptEula>
                </UserData>
            </component>
        </settings>
    </unattend>
    
  • 32-bit BIOS:

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    
    <!-- Autounattend_x86_BIOS_sample.xml 
    
    This file automates the Windows installation. 
    
         Before using this file:
          * Replace ProductKey with a product key for the edition of Windows you are installing
            (example: Windows 8 Pro)
            Note:
               The product key used in Microsoft-Windows-Setup\UserData\ProductKey\Key 
               can be used many times in different installations and is not used to activate Windows. 
               It is only used to choose which edition of Windows to install. 
    
               The individual product key is either specified by the user, or by setting 
               Microsoft-Windows-Shell-Setup\ProductKey.
         * Set the default language to your own:
           Replace "en-US" with your language code in Microsoft-Windows-International-Core-WinPE\SetupUILanguage. 
           For a list of languages, see https://go.microsoft.com/fwlink/?LinkId=206620.
         * OEMs: Replace OEMInformation with your support information
    
         To use this file: 
            Save this file on the root of a USB flash drive with the filename: Autounattend.xml
            Put the Windows DVD and the USB key into a new x86-BIOS PC. 
    -->
    
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <OEMInformation>
                    <Manufacturer>[ REPLACE WITH COMPANY NAME ]</Manufacturer>
                    <SupportHours>[ REPLACE WITH SUPPORT HOURS ]</SupportHours>
                    <SupportPhone>[ REPLACE WITH SUPPORT PHONE ]</SupportPhone>
                    <SupportURL>[ REPLACE WITH SUPPORT WEBSITE ]</SupportURL>
                </OEMInformation>
            </component>
        </settings>
        <settings pass="windowsPE">
            <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <SetupUILanguage>
                    <UILanguage>en-US</UILanguage>
                </SetupUILanguage>
                <InputLocale>en-US</InputLocale>
                <SystemLocale>en-US</SystemLocale>
                <UILanguage>en-US</UILanguage>
                <UserLocale>en-US</UserLocale>
            </component>
            <component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <DiskConfiguration>
                    <Disk wcm:action="add">
                        <CreatePartitions>
    
                            <!-- System partition -->
                            <CreatePartition wcm:action="add">
                                <Order>1</Order>
                                <Size>350</Size>
                                <Type>Primary</Type>
                            </CreatePartition>
    
                            <!-- Windows partition -->
                            <CreatePartition wcm:action="add">
                                <Order>2</Order>
                                <Extend>true</Extend> 
                                <Type>Primary</Type>
                            </CreatePartition>
    
                        </CreatePartitions>
                        <ModifyPartitions>
                            <ModifyPartition wcm:action="add">
                                <Order>1</Order>
                                <PartitionID>1</PartitionID>
                                <Label>System</Label>
                                <Format>NTFS</Format>
                                <Active>true</Active>
                            </ModifyPartition>
                            <ModifyPartition wcm:action="add">
                                <Order>2</Order>
                                <PartitionID>2</PartitionID>
                                <Format>NTFS</Format>
                                <Label>Windows</Label>
                            </ModifyPartition>
                        </ModifyPartitions>
                        <DiskID>0</DiskID>
                        <WillWipeDisk>true</WillWipeDisk>
                    </Disk>
                </DiskConfiguration>
                <ImageInstall>
                    <OSImage>
                        <InstallTo>
                            <DiskID>0</DiskID>
                            <PartitionID>2</PartitionID>
                        </InstallTo>
                    </OSImage>
                </ImageInstall>
                <UserData>
                    <ProductKey>
                        <Key>[ REPLACE WITH PRODUCT KEY ]</Key>
                    </ProductKey>
                    <AcceptEula>true</AcceptEula>
                </UserData>
            </component>
        </settings>
    </unattend>
    

Update Windows images: offline servicing and DISM

Add this answer file to boot your PC into audit mode.

  • 64-bit:

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    <!-- BootToAudit-x64.xml -->
        <settings pass="oobeSystem">
            <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <Reseal>
                    <Mode>Audit</Mode>
                </Reseal>
            </component>
        </settings>
    </unattend>
    
  • 32-bit:

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    <!-- BootToAudit-x86.xml -->
        <settings pass="oobeSystem">
            <component name="Microsoft-Windows-Deployment" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <Reseal>
                    <Mode>Audit</Mode>
                </Reseal>
            </component>
        </settings>
    </unattend>
    

Retain user profile settings

Use this answer file to retain your desktop profile settings when you generalize the PC:

  • 64-bit:

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    <!-- CopyProfile-x64.xml -->
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <CopyProfile>true</CopyProfile>
            </component>
        </settings>
    </unattend>
    
  • 32-bit:

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    <!-- CopyProfile-x86.xml -->
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <CopyProfile>true</CopyProfile>
            </component>
        </settings>
    </unattend>
    

See Also

Tasks

Update Windows settings and scripts: Create your own answer file
Update drivers and packages: Intro to offline servicing
Build to order: Use online servicing to make final updates to individual PCs

Concepts

OEM Windows Deployment and Imaging Walkthrough