Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

How to Bypass OS Selection Autounattend.xml When Installing Windows

July 27, 2024
in A, Blog, Windows 10
0
ADVERTISEMENT

Table of Contents

Bypass OS Selection Autounattend.xml When Installing Windows

Sometimes, you want to bypass the OS selection when installing Windows. For example, you want to install the same Windows edition on multiple computers, or you want to install a Windows guest VM automatically.

You can use the XML answer file for the Windows unattended installation, but it still prompts you to select the edition to install like below.

W9j4JX93LTzxkRVrI3ZZpOgjyq3O3sMj1rvJmYHNYVjYDFYCo418zznv7hvA

To bypass the OS selection page, add the <InstallFrom> tag inside the <ImageInstall> tag as follows.

...
<ImageInstall>
    <OSImage>
        <InstallTo>
            <DiskID>0</DiskID>
            <PartitionID>4</PartitionID>
        </InstallTo>
        <InstallFrom>
            <MetaData wcm:action="add">
                <Key>/IMAGE/INDEX</Key>
                <Value>6</Value>
            </MetaData>
        </InstallFrom>
    </OSImage>
</ImageInstall>
...

The content of the unattended.xml file should look like this:

TzFDyfPoxtjuhP6j51QKyoMQerKoE224TyWzkJbLliHRWth1IWkRFYq2BKFC

Inside the <InstallFrom> tag, you should modify the Value number to match your own. In our example, 6 is standard for the Windows Pro edition.

yuDYSOBDNPIlCOsNe8jCUQ1G9tGjKwkgfp2jE4TDRk3ouDRgV6WEqFu3hV8D

You can find the index number in the install.wim file. The .wim file is in the Sources folder on the USB bootable drive or ISO image file. For example, we mount the ISO image and then check the index number in the ISO image.

Open PowerShell as an administrator, then run the following command to obtain the index numbers. Make sure to modify the path of the .wim file to match yours.

dism /Get-WimInfo /WimFile:F:\Sources\install.wim
Deployment Image Servicing and Management tool
Version: 10.0.20348.681

Details for image : F:\Sources\install.wim
...
Index : 6
Name : Windows 10 Pro
Description : Windows 10 Pro
Size : 15,433,359,014 bytes
...
Index : 11
Name : Windows 10 Pro N for Workstations
Description : Windows 10 Pro N for Workstations
Size : 14,666,223,138 bytes

The operation completed successfully.

After booting from a USB drive or ISO image file, the setup starts immediately without prompting you to select the Windows edition to install.

yuDYSOBDNPIlCOsNe8jCUQ1G9tGjKwkgfp2jE4TDRk3ouDRgV6WEqFu3hV8D
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
	<settings pass="windowsPE">
		<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<SetupUILanguage>
				<UILanguage>en-US</UILanguage>
			</SetupUILanguage>
			<InputLocale>0409:00000409</InputLocale>
				<SystemLocale>en-US</SystemLocale>
				<UILanguage>en-US</UILanguage>
				<UILanguageFallback>en-US</UILanguageFallback>
			<UserLocale>en-US</UserLocale>
		</component>
		<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<DiskConfiguration>
				<Disk wcm:action="add">
					<DiskID>0</DiskID>
					<WillWipeDisk>true</WillWipeDisk>
					<CreatePartitions>
						<!-- Windows RE Tools partition -->
						<CreatePartition wcm:action="add">
							<Order>1</Order>
							<Type>Primary</Type>
							<Size>300</Size>
						</CreatePartition>
						<!-- System partition (ESP) -->
						<CreatePartition wcm:action="add">
							<Order>2</Order>
							<Type>EFI</Type>
							<Size>500</Size>
						</CreatePartition>
						<!-- Microsoft reserved partition (MSR) -->
						<CreatePartition wcm:action="add">
							<Order>3</Order>
							<Type>MSR</Type>
							<Size>128</Size>
						</CreatePartition>
						<!-- Windows partition -->
						<CreatePartition wcm:action="add">
							<Order>4</Order>
							<Type>Primary</Type>
							<Extend>true</Extend>
						</CreatePartition>
					</CreatePartitions>
					<ModifyPartitions>
						<!-- Windows RE Tools partition -->
						<ModifyPartition wcm:action="add">
							<Order>1</Order>
							<PartitionID>1</PartitionID>
							<Label>WINRE</Label>
							<Format>NTFS</Format>
							<TypeID>DE94BBA4-06D1-4D40-A16A-BFD50179D6AC</TypeID>
						</ModifyPartition>
						<!-- System partition (ESP) -->
						<ModifyPartition wcm:action="add">
							<Order>2</Order>
							<PartitionID>2</PartitionID>
							<Label>System</Label>
							<Format>FAT32</Format>
						</ModifyPartition>
						<!-- MSR partition does not need to be modified -->
							<ModifyPartition wcm:action="add">
							<Order>3</Order>
							<PartitionID>3</PartitionID>
							</ModifyPartition>
						<!-- Windows partition -->
						<ModifyPartition wcm:action="add">
							<Order>4</Order>
							<PartitionID>4</PartitionID>
							<Label>OS</Label>
							<Letter>C</Letter>
							<Format>NTFS</Format>
						</ModifyPartition>
					</ModifyPartitions>
				</Disk>
			</DiskConfiguration>
			<ImageInstall>
				<OSImage>
					<InstallTo>
						<DiskID>0</DiskID>
						<PartitionID>4</PartitionID>
					</InstallTo>
					<InstallToAvailablePartition>false</InstallToAvailablePartition>
				</OSImage>
			</ImageInstall>
			<UserData>
				<ProductKey>
					<!-- Leave the Key element blank if you are using trial ISOs -->
					<!-- <Key></Key> -->
					<!-- This is a key used only for installation, not for activation -->
					<!-- Microsoft Generic Volume License Key (GVLK): https://learn.microsoft.com/en-us/windows-server/get-started/kms-client-activation-keys -->
					<!-- Windows 10/11 Pro -->
					<!-- <Key>W269N-WFGWX-YVC9B-4J6C9-T83GX</Key> -->
					<!-- Windows 10/11 Pro for Workstations -->
					<Key>NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J</Key>
					<WillShowUI>OnError</WillShowUI>
				</ProductKey>
				<AcceptEula>true</AcceptEula>
				<FullName>admin</FullName>
				<Organization></Organization>
			</UserData>
		</component>
	</settings>
	<settings pass="offlineServicing">
		<component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<EnableLUA>false</EnableLUA>
		</component>
	</settings>
	<settings pass="generalize">
		<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<SkipRearm>1</SkipRearm>
		</component>
	</settings>
	<settings pass="specialize">
		<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<InputLocale>0409:00000409</InputLocale>
			<SystemLocale>en-US</SystemLocale>
			<UILanguage>en-US</UILanguage>
			<UILanguageFallback>en-US</UILanguageFallback>
			<UserLocale>en-US</UserLocale>
		</component>
		<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<SkipAutoActivation>true</SkipAutoActivation>
		</component>
		<component name="Microsoft-Windows-SQMApi" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<CEIPEnabled>0</CEIPEnabled>
		</component>
		<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<ComputerName></ComputerName>
			<!-- <ProductKey>W269N-WFGWX-YVC9B-4J6C9-T83GX</ProductKey> -->
		</component>
	</settings>
	<settings pass="oobeSystem">
		<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<AutoLogon>
				<Password>
					<Value></Value>
					<PlainText>true</PlainText>
				</Password>
				<Enabled>true</Enabled>
				<Username>admin</Username>
			</AutoLogon>
			<OOBE>
				<HideEULAPage>true</HideEULAPage>
				<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
				<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
				<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
				<NetworkLocation>Work</NetworkLocation>
				<SkipUserOOBE>true</SkipUserOOBE>
				<SkipMachineOOBE>true</SkipMachineOOBE>
				<ProtectYourPC>3</ProtectYourPC>
			</OOBE>
			<UserAccounts>
				<LocalAccounts>
					<LocalAccount wcm:action="add">
						<Password>
							<Value></Value>
							<PlainText>true</PlainText>
						</Password>
						<Description></Description>
						<DisplayName>admin</DisplayName>
						<Group>Administrators</Group>
						<Name>admin</Name>
					</LocalAccount>
				</LocalAccounts>
			</UserAccounts>
			<RegisteredOrganization></RegisteredOrganization>
			<RegisteredOwner>admin</RegisteredOwner>
			<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
			<FirstLogonCommands>
				<SynchronousCommand wcm:action="add">
					<Description>Control Panel View</Description>
					<Order>1</Order>
					<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 1 /f</CommandLine>
					<RequiresUserInput>true</RequiresUserInput>
				</SynchronousCommand>
				<SynchronousCommand wcm:action="add">
					<Order>2</Order>
					<Description>Control Panel Icon Size</Description>
					<RequiresUserInput>false</RequiresUserInput>
					<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 0 /f</CommandLine>
				</SynchronousCommand>
				<SynchronousCommand wcm:action="add">
					<Order>3</Order>
					<RequiresUserInput>false</RequiresUserInput>
					<CommandLine>cmd /C wmic useraccount where name="admin" set PasswordExpires=false</CommandLine>
					<Description>Password Never Expires</Description>
				</SynchronousCommand>
			</FirstLogonCommands>
			<TimeZone>SE Asia Standard Time</TimeZone>
		</component>
	</settings>
</unattend>
ADVERTISEMENT

Not a reader? Watch this related video tutorial:

5/5 - (1 vote)
Previous Post

How to Fix Cannot Install New Microsoft Teams on Windows 11

Next Post

Enhanced Mode Error The Requested Session Access is Denied in Hyper-V

Related Posts

Images Hidden Due To Mature Content Settings In CivitAI

August 31, 2024

Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

August 20, 2024

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024

How to Remove The Test Mode Watermark Without Disabling Test Mode

July 28, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory