Install Windows with a local account using an answer file (autounattend.xml) — via Microsoft Learn
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
- Create the answer file with Windows System Image Manager (part of the Windows ADK), or write it by hand following Microsoft's Unattend reference.
- In the
oobeSystempass, addMicrosoft-Windows-Shell-Setup→UserAccounts→LocalAccounts→LocalAccountwithName,Group(for exampleAdministrators),DisplayNameandPassword. - Optional, in the same component:
OOBE→HideOnlineAccountScreens=truehides the Microsoft account sign-in pages, andHideEULAPage=trueskips the license page. - Save it as
Autounattend.xmlin 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
- LocalAccount (Microsoft-Windows-Shell-Setup UserAccounts) — by Microsoft Learn
- Windows Setup Automation Overview — by Microsoft Learn
- HideOnlineAccountScreens — by Microsoft Learn
- Automate OOBE — by Microsoft Learn
- 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.