Go to ...

RSS Feed

September 29, 2022

Windows 10 Unattended install media – Part 2: Answer file for Windows Setup

Installing Windows 10 is done in three phases:
– Boot from install media, run Windows Setup (when done, restart is required)
– Configure hardware devices (one restart during, one restart when done)
– Windows Welcome (OOBE)

In normal clean install, user interaction is required in phases 1 and 3, phase 2 being run automatically without user interaction. In phase 1 user selects language and keyboard layout settings for setup process and system accounts, enters product key for specific edition or selects edition manually and accepts license if product key is not entered at this stage, and selects disk and partition to install Windows. When phase 1 is done, Windows restarts to phase 2 which is done without user interaction and when ready automatically restarts to phase 3.

In phase 3 user selects region and language settings for user accounts, creates initial admin user account, chooses OneDrive, privacy and other account settings and finally boots to desktop.

To fully automate Windows 10 installation, to create install media for a “hands free” Boot & Forget installation, we need to prepare so called answer files for both Windows Setup (phase 1) and Windows Welcome (OOBE, phase 3). Read Understanding Answer Files on Microsoft Docs, an old but still valid article to explain what answer files are and what they do.

In this post we will create an answer file called autounattend.xml which, when added to root of install media (ISO, USB, DVD) will take care of Windows system accounts region and keyboard selection, accepts license, wipes the hard disk clean, re-partitions it as user prefers, and finally starts Windows Setup. This post is quite long and might look as complicated if you have never done this, but let me assure you the procedure is fast and easy. I just wanted to make instructions clear enough for anyone to follow. I usually need about three minutes to do everything what’s told in this post, to create autounattend.xml answer file (timed it now to be sure!)

Windows SIM (System Image Manager)

WSIM is part of Windows 10 ADK (Assesment and Deployment Kit). To start creating answer files, download the latest WADK: https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install

If you are working with Windows Insider builds, download WADK Insider Preview instead: https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewADK

You can of course install each and every component of WADK if you so prefer, but to create answer files and custom ISO images, we will only need Deployment Tools:

When installed, you can find WSIM in Start > W > Windows Kits > Windows System Image Manager.

Launch WSIM. The GUI has five panels:

  1. Distribution Share
  2. Windows Image
  3. Answer File
  4. Properties
  5. Messages


In this example, we will work with panes 2 through 5. To start with, we need to create a catalog file.  A catalog file with extension .clg is a binary file, containing the settings for a specific Windows edition. Catalog files are not required to install Windows, but they are essential when creating an answer file. A catalog file can be created using a Windows 10 install.wim file.

To create a catalog file, copy install.wim file from a valid Windows 10 install media to hard disk or a USB flash drive (catalog file cannot be created from write protected WIM file). Select File > New Answer File, Click Yes and browse to the install.wim file:

To start creating a new catalog file, click Yes:

WSIM will now create a catalog file. Note that this will take some time, on my ancient Asus i5 laptop it takes around 15 minutes, on a bit younger HP laptop almost 10 minutes. If using WADK / WSIM Insider Preview, notice that a minor bug might cause you seeing this:

The catalog file was created, whatever the error message says. Just click Continue and repeat the process selecting File > New Answer File, and this time browsing to and selecting the catalog file instead of WIM file:


Catalog files are created in same folder where the original install.wim file is locatedd. They are reusable, you only need to create catalog file once, to work with additional answer files you can simply select the catalog file instead of creating a new one from a WIM file.

Add components to autounattend.xml answer file

On Windows Image pane bottom left, expand Components. Right click Microsoft-Windows-International-Core-WinPE, add it to configuration Pass 1 WindowsPE:

Next, expand Microsoft-Windows-Setup on Windows Image pane. Add component DiskConfiguration to Pass 1 by right clicking DiskConfiguration and selecting Add Setting to Pass 1, expand ImageInstall > OSImage component and add InstallTo to Pass 1, add UserData domponent to Pass 1:

The Answer File pane at top middle should now look like this when all components have been expanded:

Regional and language settings

Let’s first add Windows UI (display) language, installation language and keyboard layout. Select Microsoft-Windows-International-Core-WinPE on Answer File pane, edit properties as preferred on Properties pane top right. In my case I want to install UK English Windows 10, using Finnish keyboard layout (input language) which allows me to type in both my native languages Finnish and Swedish, as well as in English and German which I also need on daily basis:

InputLocale value for a Finnish keyboard is 040b:0000040b, everything else is set to UK English (SystemLocale, UILanguage, UILanguageFallback, UserLocale). Here’s a short list of some other InputLocale and language codes:

  • Brazil – Portuguese > 0416:00000416, pt-BR
  • Canada – English > 1009:00000409, en-CA
  • Canada – French > 0c0c:00011009, fr-CA
  • France – French > 040c:0000040c, fr-FR
  • Germany – German > 0407:00000407, de-DE
  • UK – English > 0809:00000809, en-GB
  • USA – English > 0409:00000409, en-US


For a complete list of such information, please visit: Default Input Profiles (Input Locales) in Windows

About UILanguageFallback: it is the language used for resources, notifications and system messages that are not localized (translated) into the current Windows system language. US English (en-US) can be used as a Fallback language in every language version of Windows, and should be used for all partially localized versions. Arabic (ar-SA) and Chinese Hong Kong (zh-HK) are exceptions. In addition to en-US in Arabic, the fallback language can also be French (fr-FR) and in Chinese, it can also be Hong Kong Chinese Taiwan (zh-TW).

OK, out next step is to tell Windows Setup the language for the install media. Expand Microsoft-Windows-International-Core-WinPE in the Answer File pane, then select SetupUILanguage, and set properties for the UILanguage as you like. In my case, after installing UK English Windows 10, I set it to EN-GB, where the first two letters identify the language, and the last two identify its regional version:

Notice that Microsoft has elected to show languages as xx-YY where lower case xx is the language and upper case YY is the region. However, this value is not case sensitive. Thus, even something such as eN-gB would be accepted and would work OK. I am used to using upper-case letters for both parts of the language ID myself. You can do as you like!

Partitioning the hard disk

Right click DiskConfiguration under Microsoft-Windows-Setup in the Answer File pane, then select Insert New Disk:

Next, select the new disk in the Answer File pane, and edit its properties. DiskID tells Windows Setup which disk to use to install Windows, where DiskID 0 is the primary hard disk (DiskID 1 = second HDD, and so on). Setting the WillWipeDisk value to TRUE tells setup to wipe the disk. This is the same as executing a DISKPART > SEL DISK 0 > CLEAN operation:

Now, onto the disk partitions. Creating install media for a GPT partitioned / UEFI system, we need to create four partitions (WinRE, EFI, MSR, Windows). For an MBR / BIOS system, we create only two partitions (System Reserved, Windows). Right-click CreatePartitions, then select  Insert New CreatePartition:

Repeat this step to create four partitions for GPT / UEFI install media or two partitions for MBR / BIOS install media.

This only creates these partitions. To tell Windows Setup what each partition is and how it should be setup and formatted, we must add ModifyPartition to each partition added above. Right click Modify Partitions in the Answer File pane and select Insert New ModifyPartition:

Repeat this step until you have one ModifyPartition for each CreatePartition.

Now, one by one, select a CreatePartition on Answer File pane and edit its properties as shown in the following table:

CreatePartitions - GPT partitions


Here’s a screenshot from my system, that shows how you should edit properties for the first partition on  GPT / UEFI install media:


To edit CreatePartition values for an MBR disk:

CreatePartitions - MBR partitions

The value Extend = TRUE for partition 4 (GPT disk) or partition 2 (MBR disk) (the Windows partition), tells the system to use all available space on the hard disk for a single Windows partition after all the other necessary system partitions have been created. Should you wish to create additional data partitions, you’ll need to set a specific size for the Windows partition and then add additional partitions (now or later). Only the last/rightmost partition can be set to to extend.

Next, we need to edit ModifyPartition properties for each CreatePartition as shown in the following table:

ModifyPartitions - GPT partitions

Notice that the small 16 MB Partition 3 (GPT disk), MSR or Microsoft Reserved Partition is neither formatted nor labeled. Here’s a screenshot of an example  ModifyPartition, showing properties for the WinRE partition:

ModifyPartition values for MBR disk:

ModifyPartitions - MBR partitions

Notice that when setting up an MBR disk, one more property is required make that partition active. This should be partition 1, the System Reserved partition.

To create more partitions, just create additional data partitions setting the EXTEND value for that Windows partition to FALSE, and assign it a specific size. Only the last partition on a disk can be set to EXTEND = TRUE, to use all available space left after creating other partitions.

Here’s an example using the answer file for a GPT disk. We want to create a 128 GB (131,072 MB) Windows partition, a 200 GB (204,800) Data partition, and then use the rest of the HDD for a Games partition. In that case, we would need to create six CreatePartitions and six ModifyPartitions and set properties for each one as follows:

CreatePartitions - Additional GPT partitions

ModifyPartition values for those six partitions would then be as shown in the next table:

ModifyPartitions - Additional GPT partitions

PLEASE NOTICE: The above table GPT partition properties (additional partitions) might not show correctly if using any other browser than Edge or Chrome. While I am inspecting this, in case table values are not shown, click here to view it as an image in new tab.

It is important to understand and remember that for each partition, we need one CreatePartition to create the partition, and one ModifyPartition to set its properties:

The last part of partitioning is to tell Windows Setup where to install Windows. Expand Microsoft-Windows-Setup > ImageInstall > OSImage in the Answer File pane, then select InstallTo. Set its properties: DiskID = 0 (if installing to the primary hard disk), PartitionID = 4 (GPT / UEFI) or PartitionID = 2 (MBR / BIOS):

User Data & Product Key

Here’s how to set the Microsoft-Windows-Setup > UserData  properties: AcceptEula = TRUE, FullName = Any name (optional, can be left empty), Organization = Any name (optional, can be left empty):

The last thing an answer file needs is a product key. You can use any volume licensing key if one is available, or simply a generic key. If you use a generic key, Windows will be automatically activated when installed if the machine has a valid, existing digital license for that specific Windows 10 edition. If not, activation must be peformed manually with a valid product key sometime after installation is completed.

Expand Microsoft-Windows-Setup > UserData, select ProductKey. Enter a key:

Here are some generic product keys you can use in an autounattend.xml answer file:

Windows 10 Home Single Language: 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
Windows 10 Home: TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
Windows 10 Pro: VK7JG-NPHTM-C97JM-9MPGT-3V66T

For Education, Enterprise and Server editions, please see this Microsoft Docs support article for generic install keys: Client Setup Keys. Note that generic keys may only be used for installation. Windows 10 cannot be activated with a generic key.

OK, now the answer file is ready. Next, you must validate it to see if it contains any errors:

Check the Messages pane at the bottom middle. If there are no warnings, save your answer file as autounattend.xml (File > Save As).

That’s it! When this answer file is stored at the root of the Windows 10 install media, Windows Setup needs no user interaction. It partitions the hard disk and installs Windows as instructed in autounattend.xml.

In next part of this series we will create an answer file to automate the Windows Welcome (OOBE). Stay tuned!

Links to all five parts:




Author: Kari Finn

A former Windows Insider MVP, Kari started in computing in the mid 80’s writing code for VAX / VMS systems. Since then, he’s worked in a variety of IT positions. He specializes in Windows image capture, customization, repair and deployment as well as Hyper-V virtualization. Kari is a proud Team Member at number #1 Windows site TenForums.com.

24 Responses “Windows 10 Unattended install media – Part 2: Answer file for Windows Setup”

  1. x0tester0x
    August 8, 2018 at 11:44

    Can you also add a Recovery Partition(with a Recovery Image to Recover Windows) to the Image?

  2. August 9, 2018 at 02:16


    However, how I do it is I use the custom WIM file captured in Part 5 of this series to create “factory” recovery partitions on each machine the image will be deployed, as told in this post: https://win10.guru/create-a-custom-windows-10-factory-recovery-partition/

  3. Just-a-hack
    August 28, 2018 at 14:39

    Great Job and well written! Exactly what I was looking for

  4. Mike
    October 17, 2018 at 16:28

    Can I get some clarification here? So if I understand correctly. We extract the .wim from the .iso and use that to create our catalog file. Once the catalog file is created, we can delete the .wim we extracted and use the catalog file for our answer files. After we’ve created our autounattend.xml and unattend.xml, we store those to the same location as the .iso which we extracted the .wim file from. When we mount the .iso, it will use the answer files, correct?

  5. October 17, 2018 at 21:53

    The catalog file is required to create an answer file in Windows System Image Manager . As it needs to be created from a valid install.wim file which can’t be write protected, we need to copy it first from ISO to hard disk to be able to use it. When catalog file is created, that copy of install.wim on hard disk can be deleted if you have no other use for it. Catalog file created from it can then be reused on other answer file projects.

    How and where the both answer files will be used will be explained in last, fifth part of this series. Please read all parts. Answer file unattend.xml will be stored in C:\Windows\System32\Sysprep folder before you sysprep the reference installation and capture the Windows image to custom install.wim file. The other answer file, autounattend.xml will then be stored on the root of the new custom ISO file you will create.

    All this about how to use answer files will be explained in Part 5: Sysprep & Capture Image


  6. Jola
    April 25, 2019 at 02:34

    Maybe it could help someone else.
    Using Windows 10 Pro 1809

    I get the following error during the processing of autounattend.xml

    “Windows could not set a partition active on disk 0. The target disk, partition, or volume does not support the specified operation. The error occurred while applying the unattend answer file setting. Error code: 0x80300024″

    In order to make it works I needed to do the following changes :

    CreatePartition(Order=”4″) –> Extend=true
    ModifyPartiton(Order=”4”) –> Extend=false

    I got the error when both are set to true.

    Also, I modified the size of the MSR partition to 128 as recommended in Microsoft documentation.

    • April 25, 2019 at 11:37

      Your issue is caused by not following instructions. The size of partition, or alternatively extending it (EXTEND = TRUE) is only done in CreatePartitions. In ModifyPartitions, size is no longer told, and you should leave EXTEND empty, not selecting any value (TRUE or FALSE).

  7. June 21, 2019 at 02:58

    Thanks for your posts and full tutorial. It helps me a lot. I’m testing it to my own custom computer. I have a few questions about this:

    During a clean installation, If I connect ethernet cable, will be download latest updates or remaining drivers? If not, is there any way to add this feature to the answer files (Setup or OOBE)?

    How do you exactly add recovery partition to the installation directly from de ISO file? I think it was as easy as add an new entry CreatePartitions and ModifyPartitions, but I don’t know how to go forward.

    Thanks again for your amazing job.


  8. j. lett
    July 9, 2019 at 05:32

    I like the tutorial. The tutorial seem direct and straight to the point. I got lost in understanding as i wanted to do an windows 7 pro in-place upgrade to windows 10. How will this tutorial assist in that endeavor? My ultimate goal is to perform the in-place upgrade remotely. I’m going to say WOW! when I saw you been fighting this tech battle since the days of VAX and the 8086 and 8088 processors!! lets not bring up dust bowls of has-beens..lol okay..lol

  9. Joe Mak
    July 27, 2019 at 20:53

    This is by far the BEST and clear explanation of using the systems image manager to create an answer file. Wish I had this when I first learned SIM. Truly appreciate the amount of time and effort you took to create this post.

    • July 28, 2019 at 01:14

      Thank you, Joe. Always nice to get positive feedback!

  10. Matthew Temple
    October 24, 2019 at 20:11

    Kari, if my computer has a UEFI product key embedded into the motherboard, in your answer file where you typed the generic product key in, can I simply leave this blank (with no generic windows key) where it will pull the UEFI product key automatically during installation? Thanks – Matthew

    • October 25, 2019 at 00:13

      No, the key is required. It must be a valid key, a generic edition specific key or a MAK key or any other valid product key for the edition you are deploying. If the key is not told in answer file, Windows Setup stops to ask it.

  11. jarM
    November 22, 2019 at 19:09

    Great series .. Thank you!

    How to wipe only the (C:) partition (disk 0 part 2) and keep others?

    • November 23, 2019 at 02:39

      If answer file tells Windows Setup to wipe and partition the disk, all partitions will be deleted and disk re-partitioned. All data will be erased.

      If you want to preserve data on any partition on system disk, you must remove all partitioning settings from answer file, and set WillWipeDisk setting to FALSE.

      This will run automatic Windows Setup, preserving all partitions on system disk. New Windows will be installed on top of the old one, which will be moved to Windows.old folder. This will still be a clean install, all user data, settings and customizations will be gone, but user data data can be retrieved from Windows.old folder.

      Here’s my sample autounattend.xml answer file I use when I do not want to wipe disk clean, installing UK English Windows 10 with Finnish keyboard, preserving all system disk partitions. Click expand source to see the code:

      <?xml version="1.0" encoding="utf-8"?>
      <unattend xmlns="urn:schemas-microsoft-com:unattend">
          <settings pass="windowsPE">
              <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
              <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                      <Disk wcm:action="add">
  12. Russell Gates
    January 22, 2020 at 21:04

    Great tutorial! I got almost everything to work correctly. When I create the final image and run the ISO cmd I get an error when installing to computer that no image is found. So I just use the unattended file in the boot, not the WIM. Get to the local user account after install and go from there. Your command to convert to an ISO is bomb!! I love that 🙂

    2 things I want to bring forward that I found and resolved.

    1. The current build of Win 10 does not support opening the install.wim file if using win 10×64. I had to install the VM as a x86 version then install all tools to work with the ADK.

    2. UEFI boot requires the boot disk partition activation to be set to false in the first partition. If not an error will occur at install.

    Thanks again and the best way to learn is not following directions once but following those directions a bunch of times. Especially if you’re experiencing difficulties. Overcoming the obstacle teaches a lot!
    A good ISO burner for USB drives is Rufus. Note to users: If installing on legacy BIOS make sure to change the Partition Scheme in Rufus to MBR. The default is GPT/UEFI

  13. Brian
    March 4, 2020 at 21:20

    Is there a way to set up the autounattend.xml file to automatically create the two partitions if doing a legacy install, or automatically create the four partitions if doing a UEFI install?

    I’ve created two separate autounattend.xml files depending on which type of install I’m doing. We have a lot of older machines here. Then depending on what type of install I’ll be doing, I copy that autounattend.xml to the root of the media. This gets annoying though so if there’s a way to make it automatically decide that would be great.

    I’ve tried making a new autounattend.xml file with no DiskConfiguration/ImageInstall information but that didn’t seem to work at all.

    • March 7, 2020 at 12:58

      In case you need both BIOS / MBR and UEFI / GPT install media, I would rather use free Microsoft Deployment Toolkit (MDT). You create your install media and MDT LiteTouch boot device, boot target machines, and MDT recognises if it’s BIOS or UEFI machine, partitioning the disk correctly.

      See my MDT series: Windows Deployment with MDT – Part 1: Setup

  14. Xiao
    May 15, 2020 at 17:07

    I am using autounattend.xml file to install Windows 10 Pro from a 1809 image. Windows 10 Pro is index #6 in 1809 image. I am using a USB Drive to install this. All windows iso files are at the root of drive.

    Path .\sources\install.wim
    Value Windows 10 Pro
    But it keeps showing error. Whats wrong? Is the relative path correct?

  15. June 23, 2020 at 21:16

    I got a can’t install to Disc 0 error. I believe it’s because the computers I created this answer file for are using M2 SATA drives which means the Disc Id is not 0? I’ve hunted for an answer but am at a loss. Any ideas?
    My EUFI build using your instructions has been flawless on other computers. The MBR version has worked great as well. I’m just stumped on this one.

  16. Jean
    June 24, 2020 at 01:36

    It’s a great and completely tutorial. Thanks for sharing.
    I had somo troubles when I create an answer file for windows 10 LTSC 1809. “Windows cannot find the Microsoft license terms”

  17. Anonymous
    August 15, 2020 at 09:45

    I have also a question, how to make answer file for image has two .swm files

  18. John
    November 18, 2020 at 23:29

    Kari, I’ve used this tutorial for awhile now and just used it to create an updated 20h2 image. However, I need to make a separate install that includes a few different pieces of software. I’ve exported my VM and reimported, installed the software and then recreated the image. When I go to install this I get “The unattend answer file contains an invalid product key.” It’s the exact same autounattend.xml from the working image. I’m at a loss. Any ideas?

  19. Brian
    August 2, 2021 at 14:37

    Hi Kari,

    Thank you for this article. These images have worked great for all the computers in our organization. However, we just tried installing it on a new Dell XPS and receive this error during the hard drive partitioning stage: “Setup was unable to create a new system partition or locate an existing partition. See the setup log files for more information.”

    From what I’ve read about this message, the setup is assuming drive 0 is the USB drive. Of course in the autounatted.xml file it is set to InstallTo drive 0. All of the help I have read on this error says to remove the USB drive, then re-insert it. This does not work when you use an autoattend file, because the moment you click the “ok” button on the error message the machine will reboot.

    Do you have any way around this? Thank you!

More Stories From Admin Tools

Magbo Invite Codes Links:

%d bloggers like this: