Windows 11 clean install is done in three phases:
Boot from install media, run Windows Setup
Reboot, configure hardware devices
Reboot, run Windows Welcome (OOBE)
In first phase, user needs to select system language, keyboard layout and formats. Phase 2 is done without user interaction In OOBE, phase 3, user is asked about region, keyboard, telemetry, ad preferences,and so on.
This tutorial will show how to automate phase 3, OOBE, with a simple script (an answer file). Boot from install media, select disk or partition where to install Windows, and take a break. When you come back to PC, Windows is installed, your user account created, and Welcome screen waiting for you to sign in.
Additional bonus: WIndows 11 Home edition does no longer by default allow user to setup Windows with a local account, instead a Microsoft account is required. The same is coming to Pro edition, too; Windows 11 PRO Insider Dev build 22557 (16-FEB-2022) is the first PRO build requiring Internet connection and Microsoft account, when setting up.
With this simple method, users can continue setting up Windows 11 with a local account.
How to bypass Windows 11 OOBE
|1. Mount Windows image for offline servicing|
|2. Add answer file to specific edition|
|3. Commit (save) changes to Windows image|
Mount Windows image for offline servicing
If your install media is an ISO file, you need to mount it first as a virtual DVD drive (right click, select Mount), and copy its contents to a folder. Create first a folder, in this example D:\ISO_Files, and copy everything, all files and folders, from mounted ISO to the new folder:
Open an elevated PowerShell (Run as administrator), enter following command to check available Windows 11 editions:
Get-WindowsImage -ImagePath D:\ISO_Files\Sources\install.wim | Format-Table ImageIndex, ImageName
If you have already a WIndows 11 USB install media, for example if the USB is currently shown as W: drive, enter following command to get list of editions:
Get-WindowsImage -ImagePath W:\Sources\install.wim | Format-Table ImageIndex, ImageName
Check Image Index number for the edition which you want to mount and edit:
In this example, I will select Windows 11 Pro edition to be mounted, Index 3.
Create a mount point folder. In this example, I create folder C:\Mount.
Mount selected Windows edition (Image Index) with following command:
Install.wim image in folder on HDD / SSD:
Mount-WindowsImage -ImagePath D:\ISO_Files\Sources\install.wim -Index 3 -Path C:\Mount
Install.wim image in USB install media:
Mount-WindowsImage -ImagePath W:\Sources\install.wim -Index 3 -Path C:\Mount
Add answer file to specific edition
Browse to folder
C:\Mount\Windows, and create a new folder:
Rename the new folder. The name must be Panther:
Open an elevated Notepad (Run as administrator). Copy the following answer file script, and paste it to elevated Notepad:
<?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="oobeSystem"> <component name="Microsoft-Windows-International-Core" 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"> <InputLocale>0809:0000040b</InputLocale> <SystemLocale>EN-GB</SystemLocale> <UILanguage>EN-GB</UILanguage> <UILanguageFallback>EN-GB</UILanguageFallback> <UserLocale>EN-GB</UserLocale> </component> <component name="Microsoft-Windows-Shell-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"> <OOBE> <VMModeOptimizations> <SkipAdministratorProfileRemoval>false</SkipAdministratorProfileRemoval> </VMModeOptimizations> <HideEULAPage>true</HideEULAPage> <HideLocalAccountScreen>true</HideLocalAccountScreen> <HideOnlineAccountScreens>true</HideOnlineAccountScreens> <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> <ProtectYourPC>1</ProtectYourPC> <UnattendEnableRetailDemo>false</UnattendEnableRetailDemo> </OOBE> <UserAccounts> <LocalAccounts> <LocalAccount wcm:action="add"> <Description>Local admin</Description> <DisplayName>Admin</DisplayName> <Group>Administrators</Group> <Name>Admin</Name> </LocalAccount> </LocalAccounts> </UserAccounts> <RegisteredOrganization>Eleven Forum</RegisteredOrganization> <RegisteredOwner>Kari</RegisteredOwner> <TimeZone>W. Europe Standard Time</TimeZone> </component> </settings> <settings pass="specialize"> <component name="Microsoft-Windows-Shell-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"> <OEMInformation> <Manufacturer>Eleven Forum</Manufacturer> <Model>HP ProBook 470 G5</Model> <SupportHours>24/7</SupportHours> <SupportPhone>+44 123 4567 8910</SupportPhone> <SupportProvider>Eleven Forum</SupportProvider> <SupportURL>https://www.elevenforum.com</SupportURL> </OEMInformation> <ComputerName>*</ComputerName> <OEMName>Eleven Forum</OEMName> <RegisteredOrganization>Eleven Forum</RegisteredOrganization> <RegisteredOwner>Admin</RegisteredOwner> <TimeZone>W. Europe Standard time</TimeZone> </component> </settings> </unattend>
(Click screenshot to pop out, click again to expand.)
- Line 5 = Preferred input language (keyboard layout). In this example, I set Finnish keyboard (0000040b) in UK English Windows (0809)
- Lines 6 to 8 = Install media language
- Line 9 = PC region / location
- Some other keyboard / region 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
- Complete list: Default Input Profiles (Input Locales) in Windows | Microsoft Docs
- Some other keyboard / region codes:
- Line 27 = Initial user account's description, can be any alphanumerical string
- Line 28 = Initial user account name as shown in Welcome Screen
- Line 29 = User group for initial user account, must be Administrators
- Line 30 = User profile and folder name for initial user
- Linbe 34 = Organization, any alphanumerical string
- Line 35 = PC owner, any alphanumerical string
- Lines 36 & 53 = Time zone
- About TimeZone value: If no value given, Windows defaults to time zone according to language of the install media. US English Windows defaults to Pacific time, Finnish Windows to time in Finland, UK English Windows to UK time, Japanese Windows to time in Japan. In my case as I use UK English Windows which would default to UK time but I live in Germany, I want to set time zone accordingly to CET or as Windows understands it, to W. Europe Standard Time.
- In same way, if answer file and USB install media we are preparing would be used in East Coast USA, it would be a good idea to set time zone to EST / EDST setting TimeZone value Eastern Standard Time.
- Full list of valid time zone names: Microsoft Time Zone Index Values
- Lines 42 through 52 = PC Manufacturer, PC Model, Support hours, Phone, Provider, URL, OEM Name, Organization, Owner, can be any alphanumerical string
unattend.xml, Save As Type
Save a copy of the answer file to a safe location. Once done, you can always use the same file with all Windows versions and editions in the future. No need to redo this process.
IMPORTANT! Close all File Explorer windows showing
C:\Mountfolder, or any of its subfolders!
Commit (save) changes to Windows image
In an elevated PowerShell, enter following command to save edited Windows image:
Dismount-WindowsImage -Path C:\Mount -Save
That's it. If you were servicing an install.wim file from a folder on HDD / SSD, that folder now contains everything required to create a new ISO file, see instructions on our sister site Ten Forums:
In case of a USB, it's ready to be used to install Wndows 11.
IMPORTANT NOTICE: PC must be connected to Internet for this method to work. If not, the automated OOBE will be interrupted and show this:
Stay safe, geeks, vaxxed and masked.