Creating a fully automated Windows 7 answer file

I was asked recently to build several Windows 7 32-bit  machines for user application testing. Since we don’t currently have an Win7 x86 image we would not be able to use our normal ConfigMgr Lite Touch build process.  These would need to be hand built from Windows media.  Rather than repetitively clicking through the setup steps on each machine I wanted to automate the entire process.

What I decided to do was create an answer file that would perform a fully unattended Windows installation.  An answer file is an XML file where you specify the setup options that will be answered during installation (including disk partition, user accounts, product key and much more).

In the steps below I will show you how to create and validate an answer file and then how to use it to build a Windows machine.  Here is a copy of the autounattend.xml file that I created in this post.  Right-click the link and select Save Link As to download the file.

    1. Download and install Windows Automated Installation Kit (WAIK) for Windows 7.
      Note: If you plan on creating both x86 and x64 answer files I suggest you install WAIK on a 32 bit machine. This will allow you to create both x86 and x64 answer files.  You are only able to create x64 answer files from a x64 version of WAIK.
    2. You’ll first need to copy the Windows image file to your local computer.  Insert the Windows 7 product DVD and browse to the Sources folder.  Copy the install.wim file to your local machine.
    3. Launch Windows SIM (System Image Manager) from the Start Menu.
    4. From the File menu click Select Windows Image. Browse to the install.wim file you copied in the previous step.  Click Open.
    5. When prompted to create a catalog file (.clg), click yes.  The catalog file displays the available components and packages used to build and answer file.
    6. Click Yes to the UAC warning.
    7. It may take several minutes to create the catalog file.
    8. Click File, New Answer File.
    9. Notice how the answer file is divided into the different phases of the Windows setup.  These are called configuration passes. For more details on each pass, you can reference How Configuration Passes Work.
    10. Next we need to add the necessary components from the image catalog to the appropriate configuration pass.  From the Windows Image pane (on the lower left), expand the list of components and add each of these components to your answer file by right-clicking and selecting the appropriate configuration pass.  Then set the value for each setting as listed below.

      x86_Microsoft-Windows-International-Core-WinPE_neutral –> Add to Pass 1 windowsPE
      InputLocale = en-US
      SystemLocale = en-US
      UILanguage = en-US
      UserLocale = en-US

      x86_Microsoft-Windows-Setup_neutral –> Add to Pass 1 windowsPE
      DiskConfiguration -> WillShowUI = OnError
      User Data -> AcceptEula = True
      Right-click DiskConfiguration and choose Insert new disk
      DiskID = 0
      WillWipeDisk = True
      Right-click the CreatePartitions component to choose Insert New CreatePartition
      Extend = false
      Order = 1
      Size = 10000
      Type = Primary
      Right-click ModifyPartitions and choose Insert New ModifyPartition
      Active = True
      Extend = True (this will extend the partition to use all free disk space)
      Format = NTFS
      Letter = C
      Order = 1
      Partition ID = 1
      InstallImage -> OSImage -> WillShowUI = OnError
      InstallImage -> OSImage -> Install To -> diskID = 0

      InstallImage -> OSImage -> Install To -> PartitionID = 1

      x86_Microsoft-Windows-Deployment_neutral –> Add to Pass 4 specialize
      Right-click RunSynchronous to Add RunSynchronousCommand
      Order = 1
      Path = net user administrator /active:yes

      x86_Microsoft-Windows-Shell-Setup_neutral –> Add to Pass 4 specialize
      Computername = PicnicBasket (enter your own value)

      x86_Microsoft-Windows-Shell-Setup_neutral –> Add to Pass 7 oobeSystem
      Registered Owner = Yogi Bear (enter your own value)
      TimeZone = Central Standard Time
      OOBE -> HideEULAPage =  True
      NetworkLocation = Work
      ProtectYourPC = 1
      UserAccounts -> AdministratorPassword -> Value = P@ssw0rd1 (enter your own value)
      Note: You are able to hide the password in the answer file by selecting Tools, Hide Sensitive Data.
      Right-Click LocalAccounts and click Insert New LocalAccount
      Description = Local Administrator
      DisplayName = Administrator
      Group = Administrators
      Name = Administrator
      Password -> Value = P@ssw0rd1 (enter your own value)


    11. Validate answer file by selecting Tools, Validate Answer File.  Review the errors and make changes as necessary.  You may see several warnings for settings that have been added to the answer file but have not been configured, you can ignore these warnings.
    12. Click File, Save Answer File and name it autounattend.xml.
    13. Copy the autounattend.xml file to the root of any external media.  For this example I will copy it to a USB flash drive.
    14. Insert the USB flash drive into the computer you plan to image.  Then boot the computer using the Windows 7 product DVD.  Windows setup will search the root of all media for an answer file.  If it finds one it will use the settings in the answer file during the installation.
    15. If you set up your answer file correctly the Windows setup process will run start to finish without requiring any user input.  If you find the setup prompts for any input, go back to your answer file and verify you provided the necessary values.


  • August 20, 2018 - 4:28 am

    Morgan - Very useful, thank you!ReplyCancel

  • January 21, 2019 - 3:07 pm

    Kyle - Thank you for the tutorial. Helps explain how WSIM works and gives a working answer file for windows 7. Can be extrapolated to learn WSIM for Windows 10.ReplyCancel

    • January 21, 2019 - 3:34 pm

      Todd - You are welcome!ReplyCancel

Your email is never published or shared. Required fields are marked *