Windows 10: Create media for automated unattended install of Windows 10

Discus and support Create media for automated unattended install of Windows 10 in Windows 10 Tutorials to solve the problem; How to: Create media for automated unattended install of Windows 10 [img] Information Installing Windows 10 is done in three phases: Boot from... Discussion in 'Windows 10 Tutorials' started by johngalt, Oct 29, 2017.

  1. johngalt Win User

    Create media for automated unattended install of Windows 10


    How to: Create media for automated unattended install of Windows 10

    Create media for automated unattended install of Windows 10 [​IMG]
    Information Installing Windows 10 is done in three phases:
    1. Boot from install media, run Windows Setup
    2. Configure hardware devices
    3. 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 [/i] Use links below to go to any step, back button of your browser to return to this list.


    [table][tr][td]Step One:[/td] [td]Install Windows System Image Manager[/td] [/tr] [tr][td]Step Two:[/td] [td]Create a catalog file[/td] [/tr] [tr][td]Step Three:[/td] [td]Create answer file for Windows Setup[/td] [/tr] [tr][td]Step Four:[/td] [td]Create answer file for OOBE[/td] [/tr] [tr][td]Step Five:[/td] [td]Prepare assets[/td] [/tr] [tr][td]Step Six:[/td] [td]Install Windows 10 on reference machine[/td] [/tr] [tr][td]Step Seven:[/td] [td]Customize and capture Windows image[/td] [/tr] [tr][td]Step Eight:[/td] [td]Create USB install media[/td] [/tr] [/table]


    Create media for automated unattended install of Windows 10 [​IMG]
    Tip To save some time: Step Six, installing Windows on reference machine takes some time. I suggest you start with it, and do steps One through Five on technician machine (= another computer) while Windows is installing.



    Step One [/i] 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:

    Create media for automated unattended install of Windows 10 [​IMG]


    1.3) For purpose of this tutorial, we will only need Deployment Tools. You can unselect everything else:

    Create media for automated unattended install of Windows 10 [​IMG]


    1.4) When installed, Windows SIM can be found and started from Start > W > Windows Kits > Windows System Image Manager:

    Create media for automated unattended install of Windows 10 [​IMG]





    Step Two [/i] Create a catalog file
    Create media for automated unattended install of Windows 10 [​IMG]
    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)

    Create media for automated unattended install of Windows 10 [​IMG]
    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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)

    Create media for automated unattended install of Windows 10 [​IMG]


    Create media for automated unattended install of Windows 10 [​IMG]
    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]

    2.6) In case your ISO is a multi edition one, select correct edition:

    Create media for automated unattended install of Windows 10 [​IMG]


    2.7) If creating a new catalog file, Windows SIM will tell it must create one. Click Yes:

    Create media for automated unattended install of Windows 10 [​IMG]


    2.8) Catalog will be created:

    Create media for automated unattended install of Windows 10 [​IMG]





    Step Three [/i] Create answer file for Windows setup
    Create media for automated unattended install of Windows 10 [​IMG]
    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    Create media for automated unattended install of Windows 10 [​IMG]
    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:

    Create media for automated unattended install of Windows 10 [​IMG]

    • InputLocale: Your preferred default keyboard layout
    • SystemLocale: Your country or region
    • UILanguage: Windows language
    • UserLocale: PC location

    Create media for automated unattended install of Windows 10 [​IMG]
    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


    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    3.7) In Windows Image pane, browse to and select Setup, add it to Pass 1 winPE:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    Generic product keys:
    • Windows 10 Home Single Language: 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
    • Windows 10 Home: TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
    • 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:

    Create media for automated unattended install of Windows 10 [​IMG]


    3.11) Select the disk you added in Answer File pane, set DiskID to be 0 and WillWipeDisk to true:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    3.13) Select a partition (CreatePartition) in Answer File pane, set Order 1, Size 450, Type Primary:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    [table][tr][td]PARTITION[/td] [td]EXTEND[/td] [td]ORDER[/td] [td]SIZE (MB)[/td] [td]TYPE[/td] [/tr] [tr][td]WinRE[/td] [td]False[/td] [td]1[/td] [td]450[/td] [td]Primary[/td] [/tr] [tr][td]EFI[/td] [td]False[/td] [td]2[/td] [td]100[/td] [td]EFI[/td] [/tr] [tr][td]MSR[/td] [td]False[/td] [td]3[/td] [td]16[/td] [td]MSR[/td] [/tr] [tr][td]Windows[/td] [td]True[/td] [td]4[/td] [td]Leave empty[/td] [td]Primary[/td] [/tr] [/table]

    MBR disk only: Repeat step 3.13 once and create Windows partition. Set partition properties as shown in below table. Both partitions are required:

    [table][tr][td]PARTITION[/td] [td]EXTEND[/td] [td]ORDER[/td] [td]SIZE (MB)[/td] [td]TYPE[/td] [/tr] [tr][td]System Reserved[/td] [td]False[/td] [td]1[/td] [td]450[/td] [td]Primary[/td] [/tr] [tr][td]Windows[/td] [td]True[/td] [td]2[/td] [td]Leave empty[/td] [td]Primary[/td] [/tr] [/table]


    Create media for automated unattended install of Windows 10 [​IMG]
    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!):

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    [table][tr][td]PARTITION[/td] [td]EXTEND[/td] [td]ORDER[/td] [td]SIZE (MB)[/td] [td]TYPE[/td] [/tr] [tr][td]WinRE[/td] [td]False[/td] [td]1[/td] [td]450[/td] [td]Primary[/td] [/tr] [tr][td]EFI[/td] [td]False[/td] [td]2[/td] [td]100[/td] [td]EFI[/td] [/tr] [tr][td]MSR[/td] [td]False[/td] [td]3[/td] [td]16[/td] [td]MSR[/td] [/tr] [tr][td]Windows[/td] [td]False[/td] [td]4[/td] [td]131072[/td] [td]Primary[/td] [/tr] [tr][td]Data[/td] [td]False[/td] [td]5[/td] [td]204800[/td] [td]Primary[/td] [/tr] [tr][td]Games[/td] [td]True[/td] [td]6[/td] [td]Leave empty[/td] [td]Primary[/td] [/tr] [/table]

    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    Repeat this to create a ModifyPartition setting for each partition you created in 3.13 and 3.14:

    Create media for automated unattended install of Windows 10 [​IMG]


    3.16) GPT disk only: Set properties for each partition as shown below

    Create media for automated unattended install of Windows 10 [​IMG]
    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

    Create media for automated unattended install of Windows 10 [​IMG]


    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):
      • Order = 3
      • PartitionID = 3
    • 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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    When done, your fully expanded Answer File pane should look like this:

    Create media for automated unattended install of Windows 10 [​IMG]


    3.20) Validate answer file to check for possible errors (Tools > Validate Answer File):

    Create media for automated unattended install of Windows 10 [​IMG]


    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):

    Create media for automated unattended install of Windows 10 [​IMG]


    3.22) The autounattend.xml answer file we created:

    Code:
    Create media for automated unattended install of Windows 10 [​IMG]
    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."



    Step Four [/i] 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:

    Create media for automated unattended install of Windows 10 [​IMG]


    In Windows Image pane, expand component Shell-Setup and add components as told below:
    - Add OEMInformation to Pass 4 Specialize

    Create media for automated unattended install of Windows 10 [​IMG]


    - 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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    When done, I'll expand new account in Answer File pane and set password (optional):

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:



    Step Five [/i] Prepare assets 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:
    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:

    Create media for automated unattended install of Windows 10 [​IMG]





    Step Six [/i] 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:

    Create media for automated unattended install of Windows 10 [​IMG]


    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):

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    6.5) Connect reference machine to network




    Step Seven [/i] Customize and capture Windows image

    Create media for automated unattended install of Windows 10 [​IMG]
    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    7.2) Save answer file unattend.xml in C:\Windows\System32\Sysprep folder:

    Create media for automated unattended install of Windows 10 [​IMG]


    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

    Create media for automated unattended install of Windows 10 [​IMG]
    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:

    Create media for automated unattended install of Windows 10 [​IMG]

    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):

    Create media for automated unattended install of Windows 10 [​IMG]


    7.6) Run possible software installers without saving them:

    Create media for automated unattended install of Windows 10 [​IMG]


    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

    Create media for automated unattended install of Windows 10 [​IMG]
    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


    Create media for automated unattended install of Windows 10 [​IMG]


    7.9) Sysprep will run and generalize Windows image. When ready, Windows will shut down:

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    Create media for automated unattended install of Windows 10 [​IMG]
    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:
    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.

    Create media for automated unattended install of Windows 10 [​IMG]


    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:

    Create media for automated unattended install of Windows 10 [​IMG]


    You can of course copy the file in any way you prefer. Shut down reference machine when file has been copied




    Step Eight [/i] 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 Create media for automated unattended install of Windows 10 :)

    Kari

    :)
     
    johngalt, Oct 29, 2017
    #1

  2. Is there an option to prevent the initial Windows 10 Installation Reboot

    I have created a Windows 10 USB iso and autounattend.xml file to completely automate the installation process.

    My problem is the installation automatically reboots and restarts the installation all over again. I know some of you will tell me just to remove the USB thumb drive but that defeats the purpose of an unattended installation.

    Is there an option I could change to keep the machine from automatically rebooting after the initial installation takes place?
     
    StevenCurtis80_916, Oct 29, 2017
    #2
  3. Andre Da Costa, Oct 29, 2017
    #3
  4. Tony K Win User

    Create media for automated unattended install of Windows 10

    Another excellent one, Kari! Well done!

    I was wondering what you've been working on. Lots of work went into this one I see.
     
    Tony K, Oct 29, 2017
    #4
  5. Kari Win User
    Thanks!


    Honestly, it took closer to 30 hours to write, excluding test installs but including about six hours to try to find what caused this error when I thought I was ready and tested the install media:

    Create media for automated unattended install of Windows 10 [​IMG]


    That error message when you get it after running Sysprep means installation has gone beyond salvation, you must start from scratch. At the end I found out, as so often before, that the error was due a stupid newbie mistake I had done.

    In addition, it took a bottle and a half cheap supermarket whisky, two frozen microwave pizzas and about quarter of kilo dark roasted espresso.
     
  6. Tony K Win User
    I got a glimpse of the hours you must spend after studying your basics in PS scripting, your dual-boot tutorial, then installs, and now this. I can somewhat relate, but in a much simpler fashion pounding on the keyboard doing business. Alt/Tabbing through multiple Excel & Word templates, multiple tabs in IE for material costs & other searches, estimating program, PDF viewer for blueprints, contacts app, automated telephone communications with a headset, bookkeeping/payroll, blah ba blah. Got to be somewhat routine, but then something changes or a new OS or program comes along to (so often) perform/navigate with/through things better and quicker. Then quadruple-checking proposals and contracts so to make profit instead of loosing my arse.

    Isn't that the truth! So often an overlooked simple mistake.

    LOL! Yes, there are expenses, but I can tell you're in your peaceful solitude in creating what you enjoy as you often say. I believe man was created to create. Now up in age I've learned that the only satisfaction we get out of life is working to create. We may think it's other means, but that's the bottom line.

    What's your next project?

    BTW, I'm having problems with my dual boot. None of you doings, of course. Things are wacky in 17017 and had a BSOD about an hour ago in my FCU here. I'll post in my redo thread as soon I collect more info.
     
    Tony K, Oct 29, 2017
    #6
  7. WOW! This is one really comprehensive tutorial! This is a really great help for anyone who need a very specialized automated setup image created.

    Thanks a lot!
     
    slicendice, Oct 30, 2017
    #7
  8. Kari Win User

    Create media for automated unattended install of Windows 10

    Thanks Slice *Smile

    I like to install using unattended media. It's so easy, you just plug in the USB, start the computer, go away to have a break and some 20 minutes later come back to PC to find fully installed Windows. As a bonus, it's your custom Windows with custom theme, user accounts already created, your favourite software installed and so on.

    This without a single key press or mouse click, of course excluding the one key press to tell PC to boot from USB (or DVD, this works the same way using DVD than USB).
     
  9. Kari Win User
    This one:

    Geeks, when you have created your install media, keep it up to date:

    Tweet



    — Twitter API (@user) date[/quote]

    In case you can't see the embedded tweet above:

     
  10. falconer Win User
    Thank you for this amazing tutorial! I just created my first image and tested it. Unfortunately the install stopped when it got to the wireless configuration... Cortana started talking and all, which is quite annoying, and really my main motivation for making this image. I think I need HideWirelessSetupInOOB set to True, but this wasn't set in your tutorial. Is there any way to modify the unattend.xml after imaging? Or will I have to start from scratch? Also, I had to run windows update and restart about three times to get all the drivers working properly, however there was an issue with Intel(R) Smart Sound Technology (Intel(R) SST) OED, listed under System devices in Device Manager. I had to uninstall it and reinstall to fix this. I used hyper v to get the image so it would be hardware neutral... is it common to still have these types of issues?
     
    falconer, Nov 1, 2017
    #10
  11. Kari Win User
    Hi Falconer, welcome to Ten Forums!


    My apologies, I simply forgot that from original answer file and tutorial. I've now edited step 4.7 to include it and replaced screenshot accordingly.

    I have no good excuse. I just forgot it.


    You need to start from scratch in reference machine. Thinking of that, I edited tutorial adding new step:

    I added this tip in step 7.7, to be done just before you run Sysprep:

    Create media for automated unattended install of Windows 10 [​IMG]
    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.

    A suggestion:

    You could "inject" drivers to your install media, making it specific for that PC. Tutorial: DISM - Add or Remove Drivers on an Offline Image

    Keep a copy of your custom hardware independent install.wim file, only apply drivers for a specific PC to install media you will use for that PC. If the PC is already running Windows, all devices and drivers working, and you want to reinstall, check the note in step 2.2 in above mentioned tutorial. It shows how to capture drivers from existing Windows installation. Applying them to image you have all devices working straight after setup.

    Notice that this might make your install.wim file to be bigger than 4GB which in its turn might make it impossible to use a standard FAT32 formatted USB flash drive. In that case see end of this quite long post of mine in another thread for a workaround using Rufus to create USB media: How to move Windows 10 from OLD desktop to NEW laptop - Windows 10 Forums

    To avoid need to run Windows Update after Windows has been installed, you could also apply Windows updates to your custom install media. Tutorial: PowerShell Scripting - Update Windows 10 USB install media
     
  12. falconer Win User
    Thanks for your reply, Kari! So I'm have another issue; I'm able to install my image with no problems on the HP Elitebooks that we use. However, when I try to use it on a Lenovo Thinkpad T540p or T550, I'm getting an error with creating a partition in the first part of the setup:

    "Windows could not create a partition on disk 0. The error occurred while applying the unattend answer file's <DiskConfiguration> setting. Error code: 0x80042565"

    The answer file works fine on the HP... so why am I getting this error on the Lenovo's?
     
    falconer, Nov 2, 2017
    #12
  13. Kari Win User

    Create media for automated unattended install of Windows 10

    Most common reason is that you are using autounattend.xml with partitioning scheme for GPT partitioned UEFI machines on a MBR partitioned BIOS machine or vice versa.


    EDIT:

    I just created a Generation 1 VM (BIOS / MBR) in Hyper-V and run unattended install from my UEFI / GPT install media to get this screenshot:

    Create media for automated unattended install of Windows 10 [​IMG]


    Reason for this error is me using wrong autounattend.xml file, one that tries to partition disk as GPT on a BISO based machine instead of MBR.

    I would need to prepare autounattend.xml separately for BIOS / MBR and UEFI / GPT machines, as told in tutorial starting from step 3.12. Examples showing differences in partitioning MBR and GPT disks are shown in step 3.14.
     
  14. thanks very nice and useful
     
    xXWhackerXx, Nov 2, 2017
    #14
  15. Fordlobus Win User
    Hi Kari,
    Thanks for this amazing tutorial! I have though a couple of questions, basically regarding to this step:
    3.11) Select the disk you added in Answer File pane, set DiskID to be 0 and WillWipeDisk to true:

    1. If I have several disks on my computer, how can I make sure it will prepare the image, to install windows on the right disk?
    2. As I have a Desktop and a Laptop, how can I make sure, that on each of them I'll be installing windows on the right primary disk? (Since windows changes Drive letters).
    On both cases, the primary disk will be an M2 SSD disk, but I have on both machines other disk partitions which I want to preserve from being deleted or wiped *Wink

    My last question is regarding how can I integrate the "Move users folder tutorial" (especially the part when the User folder is moved into a different drive, during Windows installation).

    What I intend is to create a Windows installation cd/usb in which I can automatically move the users folder during the installation, but silently, if possible, so I could skip the part of pressing SHIFT+F3 during the network setup screen and doing it manually. You think this is possible, to make it all automated?


    Thanks very much for your help!
     
    Fordlobus, Nov 9, 2017
    #15
Thema:

Create media for automated unattended install of Windows 10

Loading...
  1. Create media for automated unattended install of Windows 10 - Similar Threads - Create media automated

  2. Create Windows 10 installation media

    in Windows 10 Gaming
    Create Windows 10 installation media: My W10 laptop went into recovery mode taking it back to the original W7. I tried Create Windows 10 installation media to reinstall W10 to no avail. The tool made me delete the old partition as it wouldn't install on it. When I deleted both partitions. it said it was good to...
  3. Create Windows 10 installation media

    in Windows 10 Software and Apps
    Create Windows 10 installation media: My W10 laptop went into recovery mode taking it back to the original W7. I tried Create Windows 10 installation media to reinstall W10 to no avail. The tool made me delete the old partition as it wouldn't install on it. When I deleted both partitions. it said it was good to...
  4. Create Windows 10 installation media

    in Windows 10 Installation and Upgrade
    Create Windows 10 installation media: My W10 laptop went into recovery mode taking it back to the original W7. I tried Create Windows 10 installation media to reinstall W10 to no avail. The tool made me delete the old partition as it wouldn't install on it. When I deleted both partitions. it said it was good to...
  5. Correct way to run scripts in automated, unattended Windows installation

    in Windows 10 Installation and Upgrade
    Correct way to run scripts in automated, unattended Windows installation: I have some custom scripts that I have written to customise Windows 10 such as removing bloatware and setting file explorer options via Registry Editor that I use to apply to all users and/or the system. I have created a `autounattend.xml` Answer File with some simple...
  6. Creating bootable unattended ISO..

    in Windows 10 Installation and Upgrade
    Creating bootable unattended ISO..: Hi, Is there a proper way to create an unattended bootable ISO (the methods I have tried thus far do NOT work). I have the following ISO files. 1. Windows 10 1903 ISO directly downloaded from Microsoft. 2. Windows ADK for 1903. I only took the auto answer file part from...
  7. Create media for automated unattended install of Windows 10

    in Windows 10 Installation and Upgrade
    Create media for automated unattended install of Windows 10: Followed Kari's excellent tut - Create media for automated unattended install of Windows 10 WSIM Getting the following Answer File Validation problem: The setting has not been modified. It will not be saved to the answerfile....
  8. Create media for automated unattended install of Windows 10

    in Windows 10 Support
    Create media for automated unattended install of Windows 10: Followed Kari's excellent tut - Create media for automated unattended install of Windows 10 WSIM Getting the following Answer File Validation problem: The setting has not been modified. It will not be saved to the answerfile....
  9. Apply unattended answer file to Windows 10 install media

    in Windows 10 Tutorials
    Apply unattended answer file to Windows 10 install media: How to: Apply unattended answer file to Windows 10 install media [img] Information We have multiple tutorials on Ten Forums about creating a custom Windows install media and automating Windows Setup and OOBE. All those tutorials are intended for advanced users, requiring...
  10. Automated Shortcut Creating

    in Windows 10 Support
    Automated Shortcut Creating: Howdy, Right click on Desktop > Personalize > Themes > Desktop Icon Settings > Add This PC... This will make a "This PC" shortcut on desktop, which if you right click on, and choose Properties, will open up "System Details Window" rather than just showing a simple...