
Information
Installing Windows 10 is done in three phases:
- Boot from install media, run Windows Setup
- Configure hardware devices
- Windows Welcome (OOBE)
In normal install, user interaction is required in phases 1 and 3, phase 2 being run automatically without user interaction. In phase 1 user selects language and keyboard layout settings for system accounts, enters product key for specific edition
or selects edition manually if product key is not entered at this stage, and selects disk and partition to install Windows. When phase 1 is done, Windows restarts to phase 2 which is done without user interaction and when ready automatically restarts to phase 3.
In phase 3 user selects region and language settings for user accounts, creates initial admin user account, chooses OneDrive and privacy settings and finally boots to desktop.
In this tutorial we will create two
answer files to automate phases 1 and 3. An
answer file is set of commands and instructions in XML format to tell Windows setup what to do and how to proceed. We will need two answer files:
- autounattend.xml to automate phase 1, Windows Setup
- unattend.xml to automate phase 3, OOBE
When done we will create a custom USB flash drive install media for unattended install. To install Windows 10 using this USB will be totally unattended, "Hands Free"; simply boot from USB and forget it, take a break, come back to PC to find everything is done, Windows fully installed without a single key press or mouse click, without any user interaction.
The process as described in tutorial requires two computers, one or both of them can be virtual machines:
- A technician machine
- A computer or virtual machine with existing Windows 10 installation, any version and edition. Technician machine will be used to prepare answer files and other assets for custom install image
- In this tutorial I will use my W10 PRO Insider Preview Build 17025 laptop as technician machine
- A reference machine
- A computer or virtual machine which has no operating system installed. Reference machine will be used to clean install Windows 10, customize it in Audit Mode, sysprep it and finally capture Windows install image (install.wim file) from it
- If reference machine you want to use already contains an installed OS, existing installation must be wiped and replaced with a fresh clean install, or alternatively Windows 10 clean installed on another partition or disk on that machine (dual boot)
- In this tutorial I will use a new Hyper-V virtual machine created specifically for this purpose as reference machine
Both technician and reference machines can be either BIOS/MBR or UEFI/GPT machines, regardless for what partitioning system you are preparing answer files and USB install media.
Tutorial is quite long, not because topic is complicated (it's not!) but rather because it is somewhat unfamiliar for most average users. I wanted to make this tutorial as easy to follow as possible for users who have never done anything like this, which requires quite a lot explaining and screenshots.
Do not hesitate to post your questions and issues in this thread.
Contents
Use links below to go to any part, back button of your browser to return to this list.

Tip
To save some time: Part Six, installing Windows on reference machine takes some time. I suggest you start with it, and do Parts One through Five on technician machine (= another computer) while Windows is installing.
Part One
Install Windows System Image Manager
1.1) Windows System Image Manager (SIM) is part of
Windows Assessment and Deployment Kit (ADK). On technician machine, download
Windows ADK from
Windows ADK downloads - Windows Hardware Dev Center
If you are creating answer files for unattended install of Windows Insider build, download
Windows Insider Preview ADK instead:
Download Windows Insider Preview ADK
1.2) Run the installer on technician machine, select
Install to this computer. Don't panic when you see installer to tell it requires almost 7 GB, we will only need under 100 MB part of it:
1.3) For purpose of this tutorial, we will only need
Deployment Tools. You can unselect everything else:
1.4) When installed, Windows SIM can be found and started from
Start > W > Windows Kits > Windows System Image Manager:

Part Two
Create a catalog file

Note
Following steps require you are signed in on technician machine with an administrator account!
2.1) Mount Windows 10 ISO on technician machine (
tutorial)
2.2) Copy ISO contents to a folder on hard disk (
CTRL + A to select all in Explorer,
CTRL + C to copy). I will use folder
D:\ISO_Files for this and paste ISO content there (
CTRL + V). When copied, unmount ISO (
tutorial)

Note
Please notice, to continue we will need
install.wim file. If your Windows 10 ISO is
ESD based (Media Creation Tool ISO), you must first convert
install.esd to
install.wim as told in this tutorial:
Convert ESD file to WIM using DISM in Windows 10 Tutorials
When done, delete
install.esd file in your ISO_Files\Sources folder, replace it with converted
install.wim file and continue from 2.3.
2.3) Start Windows SIM (see 1.4). To create an answer file, Windows SIM needs a so called catalog file which will be based on
install.wim file for a specific edition of Windows 10
2.4) In Windows SIM, select
File > New Answer File. You will be asked if you want to open a Windows image. Select
Yes:
2.5) Browse to and select
install.wim in
ISO_Files\Sources folder (or any other folder you used to copy ISO content for instance
I_Copied_ISO_files_Here\Sources)

Note
Creating a catalog file will take quite some time. Luckily you only need to create catalog file once. It will be created in same folder where install.wim file used to create it is located, in this example case now in my
D:\ISO_Files\Sources folder. The filename will be
install_Windows 10 XXX.clg where
XXX is edition in question.
Copy the catalog file to another folder to keep it for future needs:
In the future you can open catalog file instead of creating a new one,
Select a Windows Image dialog (see 2.5) accepts both WIM and CLG (catalog) files:

2.6) In case your ISO is a multi edition one, select correct edition:
2.7) If creating a new catalog file, Windows SIM will tell it must create one. Click
Yes:
2.8) Catalog will be created:

Part Three
Create answer file for Windows setup

Note
Notice that this part is only required if you want the complete Windows Setup process to be automatized, plugging in USB and boot to it then take a break and come back later to sign in to desktop.
If you prefer a standard installation, boot to Windows Setup region and keyboard selection and partitioning Windows system disk manually with Windows Setup, you can skip this part.
3.1) Windows installation and setup is done in so called
configuration passes. More information about configuration passes on
Microsoft TechNet:
How Configuration Passes Work.
An answer file is made by adding components to various configuration passes, each component containing settings for that pass. There are seven different configuration passes, here shown in
Answer File pane in Windows SIM:
Configuration passes
5 auditSystem and
6 auditUser are not needed in normal Windows setup.
3.2) Answer file
autounattend.xml, first of two answer files we will prepare is the one that takes care of setup phase containing information about regional settings, accepting EULA, how to partition hard disk and in which partition Windows will be installed. It only contains components in
pass 1 windowsPE
3.3) In Windows SIM, expand
Components in
Windows Image pane bottom left:
3.4) Component names start with
amd64_Microsoft-Windows if you are working with catalog file for 64 bit Windows, and with
x86_Microsoft-Windows for 32 bit Windows, and end with build number of the
install.wim file used to create the catalog. In this tutorial I will omit these two parts when telling about which components need to added.
To add region and language settings to answer file, right click component
International-Core-WinPE, select
Add Setting to Pass 1 windowsPE:

Warning
Be sure to add International-Core-WinPE component, the one just above it has almost the same name without WinPE part. Adding the wrong component makes the answer file invalid!
3.5) You will see that selected component was added to
Answer File pane. Select it and enter required settings in
Properties pane:
- InputLocale: Your preferred default keyboard layout
- SystemLocale: Your country or region
- UILanguage: Windows language
- UserLocale: PC location

Note
UILanguageFallback is the language to be used for resources, notifications and system messages that are not localized (translated) to current Windows system language. US English (en-US) can and should be used for all partially localized languages. Arabic (ar-SA) and Chinese Hong Kong (zh-HK) are exceptions, in addition to en-US in Arabic fallback language can also be French (fr-FR) and in Chinese Hong Kong Chinese Taiwan (zh-TW).
As I am using
British English Windows 10 and
Finnish keyboard layout, in my case I set location and language to
en-GB (Great Britain), fallback to en-US and keyboard layout to
Finnish (040b:0000040b).
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
You can check current regional settings on technician machine in elevated PowerShell with following command and use them if answer file and USB install media you are creating will be used to install Windows 10 with the same settings:
dism /online /get-intl
3.6) Expand component
International-Core-WinPE in
Answer File pane, select
SetupUILanguage, enter the Windows language in
Properties pane. In this example as the install media is British English I enter
en-GB:
3.7) In
Windows Image pane, browse to and select
Setup, add it to
Pass 1 winPE:
3.8) Expand
Setup component, select
UserData, set
AcceptEula to
true, add organisation name (optional). Notice that in some settings which only accept preset values like
AcceptEula here (it can only be true or false), selection is made from drop down list:
This is a good example about what we are doing: If
AcceptEula was left empty or set to false, setup would stop waiting user to accept EULA. When the whole point is to automate the setup, it is important to set it to true.
3.9) Expand
UserData, select
ProductKey, add a generic product key:
Generic product keys:
- Windows 10 Home Single Language: BT79Q-G7N6G-PGBYW-4YWX6-6F4BT
- Windows 10 Home: YTMG3-N6DKC-DKB77-7M9GH-8HVX7
- Windows 10 Pro: VK7JG-NPHTM-C97JM-9MPGT-3V66T
Education, Enterprise and Server editions, see following support article for generic install keys:
Appendix A: KMS Client Setup Keys
3.10) Time to configure and partition Windows system disk. In this example I will configure a single disk which will be partitioned to use all capacity after system partitions have been created for Windows partition C:.
Right click
Setup >
DiskConfiguration in Answer File pane, select
Insert New Disk:
3.11) Select the disk you added in Answer File pane, set
DiskID to be
0 and
WillWipeDisk to
true:
When setup is run, this will wipe primary HDD, doing the same than DISKPART > SELECET DISK 0 > CLEAN.
3.12) Expand disk in Answer File pane, right click
Create Partitions and select
Insert New CreatePartition to create first partition:
If you are creating answer file for unattended install on
BIOS / MBR based machines which require two partitions (System reserved, Windows), repeat this step and create one more partition. If you are creating answer file for
UEFI / GPT based machines requiring at least four partitions (WinRe, EFI, MSR, Windows), repeat this step three more times. As I am preparing install media for UEFI / GPT, I need four partitions now:
3.13) Select a partition (CreatePartition) in Answer File pane, set
Order 1,
Size 450,
Type Primary:
This creates the first partition,
WinRE in GPT partitioning scheme or
System Reserved in MBR scheme.
3.14) GPT disk only: Repeat step
3.13 three more times to create EFI, MSR and Windows partitions. Set partition properties as shown in below table. All four partitions are required:
PARTITION |
EXTEND |
ORDER |
SIZE (MB) |
TYPE |
WinRE |
False |
1 |
450 |
Primary |
EFI |
False |
2 |
100 |
EFI |
MSR |
False |
3 |
16 |
MSR |
Windows |
True |
4 |
Leave empty |
Primary |
MBR disk only: Repeat step
3.13 once and create Windows partition. Set partition properties as shown in below table. Both partitions are required:
PARTITION |
EXTEND |
ORDER |
SIZE (MB) |
TYPE |
System Reserved |
False |
1 |
450 |
Primary |
Windows |
True |
2 |
Leave empty |
Primary |

Note
In both examples above, you will notice that we set the last partition (Windows in this case) to use all available space by setting
Extend property to
True instead of defining a size for the partition, leaving
Size property empty (it must be left empty if Extend = True, do not enter any value!):
If we would like to create additional data partitions, we would set
Extend property for Windows partition to
False and set a
Size property for it instead (size in MB), then add additional partitions setting their size as preferred, extending the last partition to use all available space. You can only use
Extend True for the last partition on disk.
In below table example properties for partitioning HDD to have a 128 GB (131,072 MB)
Windows partition, a 200 GB (204,800 MB)
Data partition, and finally use rest of the disk for
Games partition:
PARTITION |
EXTEND |
ORDER |
SIZE (MB) |
TYPE |
WinRE |
False |
1 |
450 |
Primary |
EFI |
False |
2 |
100 |
EFI |
MSR |
False |
3 |
16 |
MSR |
Windows |
False |
4 |
131072 |
Primary |
Data |
False |
5 |
204800 |
Primary |
Games |
True |
6 |
Leave empty |
Primary |
3.15) In steps 3.13 and 3.14 we only created raw partitions. Each of them needs to modified. To do that, right click
ModifyPartitions and select
Insert New ModifyPartition:
Repeat this to create a
ModifyPartition setting for each partition you created in
3.13 and
3.14:
3.16) GPT disk only: Set properties for each partition as shown below

Warning
Only set a value for a setting when told so! Leave all other value fields empty.
First the
WinRE partition. Set it as follows:
- Format = NTFS
- Label = WinRE
- Order = 1
- PartitionID = 1
- TypeID = DE94BBA4-06D1-4D40-A16A-BFD50179D6AC
WinRE partition is the only one requiring specific
TypeID.
The ID must be exactly as shown above!
Repeat the above three times, selecting a not yet modified
ModifyPartition in Answer File pane and setting the properties for it. Below the properties for each of four GPT partitions:
- ModifyPartition 1 (WinRE):
- Format = NTFS
- Label = WinRE
- Order = 1
- PartitionID = 1
- TypeID = DE94BBA4-06D1-4D40-A16A-BFD50179D6AC
- ModifyPartition 2 (EFI):
- Format = FAT32
- Label = System
- Order = 2
- PartitionID = 2
- ModifyPartition 3 (MSR):
- ModifyPartition 4 (Windows):
- Format = NTFS
- Label = Windows
- Letter = C
- Order = 4
- PartitionID = 4
Remember: only modify properties to settings as told above, leaving other fields empty! Notice that small 16 MB MSR partition will
not be formatted nor does it get a label.
When done, you should have four
CreatePartition components to create partitions, and four
ModifyPartition components to configure them:
3.17) MBR disk only: For MBR disk you only need two ModifyPartitions. Set their properties as shown below:
- ModifyPartition 1 (System Reserved):
- Active = True
- Format = NTFS
- Label = System
- Order = 1
- PartitionID = 1
- ModifyPartition 2 (Windows):
- Format = NTFS
- Label = Windows
- Letter = C
- Order = 2
- PartitionID = 2
3.18) GPT disk only: Expand
ImageInstall >
OSImage component in Answer File pane, select
InstallTo, set
DiskID =
0 and
PartitionID =
4 to tell Windows setup to install Windows on
partition 4:
MBR disk only: Expand
ImageInstall >
OSImage component in Answer File pane, select
InstallTo, set
DiskID =
0 and
PartitionID =
2 to tell Windows setup to install Windows on
partition 2
3.19) Answer file has now all components and settings it needs. It also contains something not needed; before proceeding, delete all unused components (light blue icon) in
Answer File pane under
Setup main component, only leaving the three we've modified (dark blue icon: DiskConfiguration, ImageInstall, UserData).
You can delete an unused component by selecting it and pressing
DEL or right clicking it and selecting
Delete:
When done, your fully expanded Answer File pane should look like this:
3.20) Validate answer file to check for possible errors (Tools > Validate Answer File):
3.21) Save answer file as
autounattend.xml in
D:\ISO_Files folder (the folder where ISO content was copied to in step 2.2):
3.22) The
autounattend.xml answer file we created:
Code:
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" 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">
<SetupUILanguage>
<UILanguage>en-GB</UILanguage>
</SetupUILanguage>
<InputLocale>040b:0000040b</InputLocale>
<SystemLocale>en-GB</SystemLocale>
<UILanguage>en-GB</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>en-GB</UserLocale>
</component>
<component name="Microsoft-Windows-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">
<DiskConfiguration>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Size>450</Size>
<Type>Primary</Type>
</CreatePartition>
<CreatePartition wcm:action="add">
<Extend>true</Extend>
<Order>4</Order>
<Type>Primary</Type>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>3</Order>
<Size>16</Size>
<Type>MSR</Type>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>2</Order>
<Size>100</Size>
<Type>EFI</Type>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Format>NTFS</Format>
<Label>WinRE</Label>
<Order>1</Order>
<PartitionID>1</PartitionID>
<TypeID>DE94BBA4-06D1-4D40-A16A-BFD50179D6AC</TypeID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Format>FAT32</Format>
<Label>System</Label>
<Order>2</Order>
<PartitionID>2</PartitionID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Format>NTFS</Format>
<Label>Windows</Label>
<Letter>C</Letter>
<Order>4</Order>
<PartitionID>4</PartitionID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Order>3</Order>
<PartitionID>3</PartitionID>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
</DiskConfiguration>
<UserData>
<ProductKey>
<Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key>
</ProductKey>
<AcceptEula>true</AcceptEula>
<Organization>Ten Forums</Organization>
</UserData>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>4</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
</component>
</settings>
<cpi:offlineImage cpi:source="catalog://agm-w10pro02/hyper-v/iso_files/sources/install_windows 10 pro.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

Note
The sample answer file above is for GPT disk on a UEFI machine..
Notice that this answer file is for installing a 64 bit Windows 10 because the catalog file was based on a 64 bit install.wim file. If you want to use same answer file in installing 32 bit Windows, you must change all
ProcessorArchitecture="amd64" references in answer file to
ProcessorArchitecture="x86."
Part Four
Create answer file for OOBE
4.1) The second answer file is to take care of OOBE, to automate it bypassing region and keyboard selection and user account creation. To start, open Windows SIM and create a new answer file as you did in steps
2.3 through
2.5. Because the catalog file is already created, use it instead of
install.wim to speed up process
4.2) In step 3.4 you saw how to add components to answer file. Add required components now from
Windows Image pane bottom left in Windows SIM to answer file as you did making the first answer file. First, add component
International-Core to
Pass 7 oobeSystem:
In Windows Image pane, expand component
Shell-Setup and add components as told below:
- Add
OEMInformation to
Pass 4 Specialize
- Add
Shell-Setup > OOBE to
Pass 7 oobeSystem
- Add
Shell-Setup > UserAccounts to
Pass 7 oobeSystem
Answer File pane should look like this after you have added necessary components:
4.3) In Answer File pane, select
Shell-Setup in
pass 4 specialize. Set
CopyProfile =
true,
OEMName as you wish,
RegisteredOrganization as you wish,
RegisteredOwner as you wish, and
TimeZone if required (see explanation below screenshot). Leave all other property value fields empty:
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
4.4) Select
Shell-Setup >
OEMInformation in Answer file pane, add
Manufacturer,
SupportHours,
SupportPhone and
SupportURL as you wish. If you want to add an OEM logo later (see step 5.1) when we prepare assets and install Windows on reference machine, add logo path and filename as
C:\Windows\System32\oemlogo.bmp:
Notice that
OEMInformation is optional, not required. When added, if set the OEM logo image will be shown in
Control Panel > System, and OEM info + link to given support URL in both
Control Panel > System and
Settings > System > About:
4.5) Select
International-Core in Answer File pane, set all values exactly as we did for the first answer file in step
3.5:
4.6) Select
Shell-Setup in Answer File pane in
pass 7 oobeSystem, set the same
RegisteredOrganization,
RegisteredOwner and
TimeZone as in step
4.3:
4.7) Select
OOBE in Answer File pane, set
HideEULAPAge =
True, set
HideOEMRegistrationScreen =
True, set
HideOnlineAccountScreen =
True, set
HideWirelessSetupInOOBE =
True, set
ProtectYourPC =
1, set
UnattendEnableRetailDemo =
False:
ProtectYourPC (
read more) value can be 1, 2 or 3:
- 1 = Recommended (default) level of protection
- 2 = Only updates are installed.
- 3 = Automatic protection is disabled.
4.8) Expand
UserAccounts, right click
LocalAccounts, select
Insert New LocalAccount:
Fill in
Description,
DisplayName (as shown in login screen, Start etc.),
Group (
Administrators for admin accounts,
Users for standard accounts), and
Name (user profile folder name). I will first setup an admin account, I want all my machines to have a local admin account simply named as
Admin:
When done, I'll expand new account in Answer File pane and set password (optional):
Don't worry; although shown in Windows SIM, when we save answer file the password will be encoded, not shown. Be sure to remember the password if you set one here!
I will repeat the above steps once because I also want to make a standard account for myself. Creating both accounts now they already exists on each machine on which I will install my custom Windows image:
I will not set a password for this standard account. When not set, a user (myself in this case) can create a new password when signing in first time.
4.9) Validating my answer file (see step 3.20) shows no errors:
4.10) Create a new folder on technician machine to store assets for reference machine. I use folder
Users\Kari\OneDrive\Assets to allow easy transfer using OneDrive. Save this answer file to your
Assets folder as
unattend.xml:
If you will use a physical PC as reference machine, you can save your assets on a USB flash drive instead
Close Windows SIM
4.11) The
unattend.xml answer file we created:
Code:
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="oobeSystem">
<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>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<ProtectYourPC>1</ProtectYourPC>
<UnattendEnableRetailDemo>false</UnattendEnableRetailDemo>
</OOBE>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>TQB5AFMAZQBjAHIAZQB0AFAAYQBzAHMAdwBvAHIAZABQAGEAcwBzAHcAbwByAGQA</Value>
<PlainText>false</PlainText>
</Password>
<Description>Main local admin account</Description>
<DisplayName>Admin</DisplayName>
<Group>Administrators</Group>
<Name>Admin</Name>
</LocalAccount>
<LocalAccount wcm:action="add">
<Description>Daily standard account</Description>
<DisplayName>Kari</DisplayName>
<Group>Users</Group>
<Name>Kari</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<RegisteredOrganization>Ten Forums</RegisteredOrganization>
<RegisteredOwner>Kari</RegisteredOwner>
<TimeZone>W. Europe Standard Time</TimeZone>
</component>
<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>040b:0000040b</InputLocale>
<SystemLocale>en-GB</SystemLocale>
<UILanguage>en-GB</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>en-GB</UserLocale>
</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>
<Logo>C:\Windows\System32\oemlogo.bmp</Logo>
<Manufacturer>Ten Forums</Manufacturer>
<SupportHours>24/7</SupportHours>
<SupportPhone>+44 123 456 789</SupportPhone>
<SupportURL>https://www.tenforums.com</SupportURL>
</OEMInformation>
<CopyProfile>true</CopyProfile>
<OEMName>Ten Forums</OEMName>
<RegisteredOrganization>Ten Forums</RegisteredOrganization>
<RegisteredOwner>Kari</RegisteredOwner>
<TimeZone>W. Europe Standard time</TimeZone>
</component>
</settings>
<cpi:offlineImage cpi:source="catalog://agm-w10pro02/hyper-v/iso_files/sources/install_windows 10 pro.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
5.1) Save optional
OEM logo image to
Assets folder. It must be a 120 * 120 pixels bitmap image (.bmp). Prepare and save custom Windows theme files to same folder, when we will customize reference machine in Audit Mode you can't use
Personalize options to change colors and wallpaper but you can apply a theme pack file to do it for you.
5.2) On technician machine, open
Notepad, copy following code and paste in Notepad, save in
Assets folder as
RunOnce.bat:
Code:
echo Y | del %appdata%\microsoft\windows\recent\automaticdestinations\*
del %0
Do not run the batch file, it deletes itself! If you want to test it, make a copy and run it instead.
This file will be copied to default user profile on reference machine, and from there to every user profile. It runs itself every time any user signs in first time clearing
This PC,
Quick Access and
Recent files views, then deletes itself. Without it, some leftovers from reference machine's built-in administrator account would be shown in Quick Access.
5.3) If you have installers for software you would like to include in your custom Windows image, save them, too, in
Assets folder.
5.4) In this example my
Assets folder contains the
unattend.xml answer file, an
OEM logo image,
RunOnce.bat from step
5.2, two themepack files and as an example of software installers, installer for
VLC Player:

Part Six
Install Windows 10 on reference machine
6.1) Any PC or virtual machine can be used as reference machine. In this example I created a Generation 2 Hyper-V virtual machine with a 50 GB virtual hard disk
6.2) If using a Hyper-V VM as reference machine, open its settings before booting and disable (unselect)
automatic checkpoints (yellow highlight in screenshot). Be sure you are using
Standard checkpoints:
6.3) Install Windows 10 normally until
OOBE starts and region settings screen is shown. Do not select anything, just press
CTRL + SHIFT + F3 to restart to
Audit Mode (press and hold down both CTRL and SHIFT keys, press F3, release all three keys):
6.4) Windows will restart and sign you in to Audit Mode with built-in administrator account.
Sysprep Prompt will be shown on screen. Click
Cancel to close it:
6.5) Connect reference machine to network
Part Seven
Customize and capture Windows image

Note
In this example case I am using OneDrive to transfer assets from technician machine to reference machine. You can of course transfer assets in any way you want to, for instance if your reference machine is a physical PC, you can save assets to a USB flash drive and use it for transfer.
Network cannot be used, sharing being disabled in Audit Mode.
7.1) If you saved the assets to
OneDrive as I did, open
Internet Explorer (WIN + R > type iexplore > press Enter, Edge can't be used in Audit Mode), go to
onedrive.live.com and open the
Assets folder:
7.2) Save answer file
unattend.xml in
C:\Windows\System32\Sysprep folder:
7.3) Save
oemlogo.bmp in
C:\Windows\System32 folder
7.4) Save
RunOnce.bat in
C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Start-up folder

Tip
The
AppData folder is hidden. A practical way to open it in
Save as dialog is to type
%appdata% in address field and press Enter. This opens the
AppData\Roaming folder and you can now click yourself deeper to target folder:

7.5) Theme files do not have to be saved, just open them to apply. If you want to install multiple themes to your custom image, open the one you want to be default theme for all user accounts last (you can't change themes in Audit Mode, just apply them):
7.6) Run possible software installers without saving them:
7.7) Create two new folders on root of C: drive, name them
C:\Image and
C:\Scratch. These folders will be needed when we capture the image

Tip
If you are using a Hyper-V VM as reference machine, create a checkpoint now. It allows you to return to this point in few seconds if something goes wrong with image capture or to make changes in image before it's captured.
7.8) When done, press
WIN + R to open
Run prompt, type following command and press
Enter:
C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe
7.9) Sysprep will run and generalize Windows image. When ready, Windows will shut down:
7.10) Boot the reference machine from WinPE or Windows install media.
In any case do not let it boot from hard disk!. In my case now, as I am using Generation 2 Hyper-V VM, I first changed the boot order in VM settings:

Note
Hyper-V can be a bit tricky, you have to press a key to boot from install media or WinPE but the VM window opens slowly. If you miss the key press, reset VM as soon as it starts booting from VHD (Action menu > Reset) and try again.
I repeat: do not let reference machine boot from HDD or in case of VM, from VHD!
7.11) When booted from install media, press
SHIFT + F10 to open
Command Prompt. Type
diskpart and press
Enter (#1 in screenshot below), type
list vol and press
Enter (#2), type
exit and press
Enter (#3)
Check drive letter for Windows partition (#4), all drives are listed under
list vol command. In most cases it will be
C: but occasionally, depending on hardware and connected disks, booting to WinPE or install media changes drive letters.
Enter the following command and press
Enter to capture Windows image (#5). Replace drive letter
C: if necessary in
/imagefile,
/capturedir and
/ScratchDir switches:
Code:
dism /capture-image /imagefile:C:\Image\install.wim /capturedir:C:\ /ScratchDir:C:\Scratch /name:"Win10" /description:"My Custom Win10 Image" /compress:maximum /checkintegrity /verify
Name is required, it must be in quotes and can be anything you'd prefer. Description is optional but recommended, also in quotes.
Dism will capture the image. Wait until it's done (#6), restart reference machine and let it boot normally from hard disk. Notice that boot will take quite some time because reference machine goes through automated OOBE.
7.12) When reference machine has booted to desktop, sign in to your administrator account using password you set in answer file in
step 4.8
7.13) On technician machine, delete
ISO_Files\Sources\install.wim file
7.14) When reference machine has booted to desktop, copy newly captured Windows image (install.wim file) from
C:\Image folder to technician machine to
ISO_Files\Sources folder, same folder from where you deleted the original
install.wim in previous step. In my case now I shared
ISO_FIles folder on technician machine and mapped it on reference machine, copying new
install.wim directly to target folder:
You can of course copy the file in any way you prefer. Shut down reference machine when file has been copied
Part Eight
Create USB install media
8.1) The
ISO_Files folder on technician machine now contains everything needed to create a "hands free" ISO:
- Windows 10 install files copied from original ISO (step 2.2)
- Original install.wim in Sources folder replaced with custom one (step 7.14)
- Custom autounattend.xml answer file to take care of Windows setup (step 3.21)
8.2) Create custom USB flash drive from
ISO_Files folder by running
PowerShell script as told in following tutorial:
PowerShell Scripting - Create USB Install Media for Windows 10 Installation Upgrade Tutorials
Alternatively, you can make an ISO image as told in
Part Five in following tutorial, the tool used (Deployment and Imaging Tools Environment) was installed on your technician machine together with
Windows SIM in step 1.2 and you do not have to download it again:
Create Windows 10 ISO image from Existing Installation Installation Upgrade Tutorials
When you have created new ISO, use your preferred tool / method to create USB or DVD install media
That's it geeks! Happy computing :)
Kari