Skip to content

Install Windows with a local account using an answer file (autounattend.xml) — via Microsoft Learn

Trickmedium riskNeeds adminHomeProEducationEnterpriseWindows 11Windows 10

Microsoft documents a way to create local accounts during setup: an answer file. Put a file named Autounattend.xml with a UserAccounts/LocalAccounts section in the oobeSystem pass at the root of a USB drive, and setup creates that account itself, so no online sign-in is needed.

Takes effect right away

How to do it

  1. Create the answer file with Windows System Image Manager (part of the Windows ADK), or write it by hand following Microsoft's Unattend reference.
  2. In the oobeSystem pass, add Microsoft-Windows-Shell-Setup → UserAccounts → LocalAccounts → LocalAccount with Name, Group (for example Administrators), DisplayName and Password.
  3. Optional, in the same component: OOBE → HideOnlineAccountScreens = true hides the Microsoft account sign-in pages, and HideEULAPage = true skips the license page.
  4. Save it as Autounattend.xml in the root of the install USB (or a second USB stick) and boot from the installer.
Setup copies the answer file into %WINDIR%\Panther on the new PC, so any password in it stays readable there. Use a temporary password and change it after setup, or delete the cached file. Microsoft says not to use SkipMachineOOBE. In October 2025 Microsoft started removing the known shortcuts for making a local account in OOBE (such as the BypassNRO script and the ms-cxh:localonly trick), beginning with Insider build 26220.6772. Those shortcuts aren't listed here because they are being removed.

Sources

Source reviewed
2026-11-02
Link checked
2026-11-02
Tested hands-on
Not by Oddbyte.Me

Oddbyte.Me hasn't tried this on every Windows build, so keep the undo handy.

local accountoffline accountunattendautounattendoobemicrosoft accountinstall

More in Setup & Install