Documentation

Windows Autounattend XML: Plan a Repeatable PC Setup

An answer file is a set of installation instructions, not a shortcut around Windows requirements. Begin with language and disk choices, test on a virtual machine, and retain a recovery path before using the XML on real hardware.

What this guide helps you decide

Treat disk partitions, local accounts and first-logon scripts as separate decisions. A syntax-valid XML can still produce an unusable installation if the answer file targets the wrong hardware or deletes the wrong disk.

Validation after changing Windows

Test a disposable virtual machine first, inspect the resulting disk layout and sign-in behavior, and confirm Windows Update and network adapters work before moving to production hardware.

Checklist for a safe first test

  • Keep a copy of the original ISO and the answer file you tested.
  • Check target drive numbers, account settings and language configuration.
  • Run setup in a VM without access to personal disks before touching hardware.

Independent reference: Software options and names can change between releases. Compare against the upstream Winhance release notes and Microsoft Windows support before applying unfamiliar options.

Reader note: This independent Windows guide focuses on practical steps, trade-offs and checks after changes. Save a backup, use supported Windows controls and confirm results on your own PC before repeating a preset. See our pre-change checklist.

Where the file goes

Name it autounattend.xml and place it in the root of the installation media (or on a separate USB stick / floppy image). Windows Setup searches a fixed list of locations and picks it up automatically - no key press, no /unattend switch. For an already-deployed image the same XML is applied as unattend.xml under C:\Windows\Panther.

The passes you will actually touch

  • windowsPE - language of Setup itself, product key, disk configuration and the image to install. Everything destructive lives here.
  • specialize - computer name, time zone, machine-scoped registry writes, domain join. Runs after the image is applied.
  • oobeSystem - the out-of-box experience: EULA, region screens, network requirement, local accounts, auto-logon and FirstLogonCommands.

Two other passes (offlineServicing, auditUser) exist and are rarely needed outside enterprise imaging.

A minimal skeleton

<unattend xmlns="urn:schemas-microsoft-com:unattend">
  <settings pass="oobeSystem">
    <component name="Microsoft-Windows-Shell-Setup" ...>
      <OOBE>
        <HideEULAPage>true</HideEULAPage>
        <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
        <ProtectYourPC>3</ProtectYourPC>
      </OOBE>
      <UserAccounts>...</UserAccounts>
    </component>
  </settings>
</unattend>

The component elements need their full processorArchitecture, publicKeyToken and language attributes; that boilerplate is why almost nobody writes these by hand. Use a generator and review the output - the field-by-field walkthrough is in the autounattend guide.

Windows 11 hardware and account requirements

Windows 11 Setup checks TPM, Secure Boot and CPU support, and pushes a Microsoft account during OOBE. An answer file can create a local account and skip the online account screens; the hardware checks are bypassed with registry writes during windowsPE (the LabConfig keys) on unsupported test machines. Whether to do that is a decision about support and updates, not just a technical one - read the guide before shipping it into production media.

Disk configuration erases data

A windowsPE DiskConfiguration block with WillWipeDisk set to true destroys the target disk without a prompt - that is the point of an unattended install. Test in a VM first, every time.

Building the media

An answer file usually travels with a prepared ISO: drivers injected, unwanted packages removed, scripts staged. WIMUtil covers that side - sourcing the ISO, adding the XML, adding drivers and writing the stick. Combined with a .winhance configuration file applied at first logon, a fresh machine can arrive debloated and configured without a single manual step, following the same choices described in the debloat guide.

Frequently asked questions

Where do I put autounattend.xml?

In the root of the installation media. Windows Setup finds it automatically; no command-line switch is required.

Can autounattend.xml create a local account on Windows 11?

Yes. The oobeSystem pass can add a local account and hide the online account screens, which skips the Microsoft account requirement during setup.

Related reading