You are on page 1of 2

Custom Windows 10 ISO image instructions using virtual machine

Prerequisites:

1. Hyper-V manager
2. Deployment and Imaging Tools Environment
3. Windows 10 clean ISO.

Creating a customized ISO image with pre-installed software and no user accounts

1. Create a VHD using Hyper-V


2. Use the original iso to perform a clean install
3. After rebooting, at the Basics screen, press CTRL+SHIFT+F3 to restart Windows in Audit
Mode. When it starts, a Sysprep prompt will show in the middle of display. Do not close it!
4. Install preffered software, customize tiles and themes (for any setting from Personalize
menu, Windows must be activated). Do not run any software installed!
5. In Notepad, paste the following code:

<?xml version="1.0" encoding="utf-8"?>


<unattend xmlns="urn:schemas-microsoft-com:unattend">
<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">
<CopyProfile>true</CopyProfile>
</component>
</settings>
</unattend>

Save as:
File name: unattend.xml
Save as type: All files
Location: C:\Windows\System32\Sysprep
6. Run as admin- Notepad. Paste the following code:

echo Y|del %appdata%\microsoft\windows\recent\automaticdestinations\*


del %0

Save as:
File name: runonce.bat
Save as type: All files
Location: %appdata%\Microsoft\Windows\Start Menu\Programs\Startup

7. Delete all existing downloads and run a Disk cleanup. After that, in Hyper-V, create a
checkpoint.
8. In Sysprep dialog still open on your desktop, select System Cleanup Action: Enter System
Out-of-Box Experience (OOBE), select Shutdown Options: Shutdown, select (tick the box)
Generalize, click OK.
9. On the host machine (the physical one), open Disk management. From the Actions menu,
select Attach VHD. Be careful to choose the folder where VHDs are saved, choose to see all
files and choose the checkpoint with the most recent time stamp, and thick Read Only box
(it is absolutely necessary!)
10. Run as admin CMD. Enter the following command to create a new install.wim file.

dism /capture-image /imagefile:D:\install.wim /capturedir:K:\ /name:"AnyName"


/compress:maximum /checkintegrity /verify /bootable

Replace drive letter D in imagefile switch with the drive letter and folder path of the target where
you want install.wim be written, and drive letter K in capturedir switch with the Windows system
partition of your mounted VHD.

11. When done, detach the VHD / VHDX or AVHD / AVHDX file from host by right clicking it in
Disk Management and selecting Detach VHD

Create a bootable ISO:

1. Mount the original windows ISO image on a virtual drive ( like PowerISO, and everything
similar to that), then copy its content to a desired location on your HDD, in folder (ex.
iso_files).
2. Copy the install.wim file created earlier to Sources folder under iso_files.

Note: If the original ISO is made with Windows Media Creation Tool, the ISO_Files\Sources
folder contains an install.esd file instead of install.wim.
In this case you will naturally not get "File exists" prompt. Simply delete the install.esd file
and paste your custom install.wim to replace it.
3. Run as admin - Deployment and Imaging Tools interface
4. The path shown in prompt is annoyingly long. To shorten it and jump to root of drive C:, type
cd\ and hit Enter. The cd command (abbreviation from Change Directory) changes the
current working folder (directory), in this case to root of current drive (backslash \ = root,
two dots .. = up one level).Enter the following command:

oscdimg.exe -m -o -u2 -udfver102 -


bootdata:2#p0,e,bd:\iso_files\boot\etfsboot.com#pEF,e,bd:\iso_files\efi\microsoft\b
oot\efisys.bin d:\iso_files d:\14986PROx64.iso

Note: Replace three instances of d:\iso_files (green highlight in above code box and screenshot)
with drive and folder where you copied Windows installation files. Notice that this is not a typo: first
two of these instances are typed as argument for switch -b without a space in between the switch
and argument, to tell oscdimg command where to find boot files to be added to ISO.
Replace d:\14986PROx64.iso (highlighted red) with drive and path where you want to store the ISO
image plus your preferred ISO file name.

You might also like