Modern Windows operating system deployment typically depends on network and server infrastructure services like Microsoft Endpoint Configuration Manager (formerly known as SCCM).
What if you need to deploy in an environment that does not have these tools?
This article details the process for customizing the Windows installer ISO to incorporate an answer file, allowing you to consistently deploy the operating system without network and server resources. This process should work well for Windows 10 or 11.
Prerequisite Set Up
Download and install the latest Microsoft Assessment and Deployment Kit. Select the Deployment Tools feature during installation. This kit provides the Windows System Image Manager (“SIM”); and Deployment and Imaging Tools Environment (including
oscdimg.exe) tools required for this process.
Create the following directory structure. You may choose a different location (such as your user profile), but avoid using a directory path that includes spaces.
|Parent directory for all Imaging assets|
|Location for storing 3rd party drivers|
|Location for storing the contents of the Microsoft Windows DVD ISO|
|Output location for customized ISOs|
|Location for storing |
|Location for mounting WIM files|
|Location for storing WIM and associated catalog file|
Obtain Windows Installer Media
- See Create installation media for Windows to obtain a Windows ISO.
- Double-click (mount) the ISO and copy the contents to
- Eject (unmount) the DVD ISO.
Obtain 3rd Party Drivers
Obtain any drivers you wish to preload and extract them to individual subdirectories of
C:\Imaging\Drivers\. You can use 7-Zip to extract drivers from CAB files.
Create a List of Undesired Appx Packages (optional)
Windows includes a handful of preloaded Appx packages that you may wish to remove to suit your environment. Perform a temporary manual installation of your target edition (be sure to do this offline to avoid updates) and use the following PowerShell command to list all installed Appx packages. Make a list of any you wish to remove. These will be referred to as
[APPX] in future steps.
> Get-AppxProvisionedPackages -Online
Create a Catalog and Answer File
- Open Windows SIM as Administrator.
File > Select Windows Image > C:\Imaging\WIM\install.wim
- Choose your desired edition e.g., Home, Pro, Enterprise, etc.
- Click Yes to create a catalog.
File > New Answer File > C:\Imaging\DVD\Autounattend.xml
- Populate your answer file as desired.
- Save and close the answer file, windows image, and Windows SIM.
Determine the Edition Index
- Open the Deployment and Imaging Tools Environment as Administrator.
Dism /Get-WimInfo /WimFile:"C:\Imaging\WIM\install.wim"
- Find your edition and note the Index number. This will be referred to as
[INDEX]in the next steps.
Open the Deployment and Imaging Tools Environment as Administrator for the following steps.
Export the Edition
In this step, we export the desired
install.wim to a new WIM.
> Dism /Export-Image /SourceImageFile:"C:\Imaging\WIM\install.wim" /SourceIndex:[INDEX] /DestinationImageFile:"C:\Imaging\DVD\sources\install.wim"
Mount the Image
In this step, we mount the newly exported WIM. This new WIM contains only the exported edition, so the index will now be “1”.
> Dism /Mount-Image /ImageFile:"C:\Imaging\DVD\sources\install.wim" /Index:1 /MountDir:"C:\Imaging\Mount"
Here we add drivers to the WIM. This command is recursive so be sure your
C:\Imaging\Drivers directory contains only the desired drivers.
> Dism /Add-Driver /Image:"C:\Imaging\Mount" /Driver:"C:\Imaging\Drivers" /recurse
Copy Media Assets (optional)
If your answer file references any OEM media for e.g., custom logos or wallpaper, they will be copied in this step.
> md "C:\Imaging\Mount\Windows\System32\OEM" > copy "C:\Imaging\Media\*.*" "C:\Imaging\Mount\Windows\System32\OEM\"
Remove Undesired Appx Packages
Refer to your list of undesired Appx packages created above. Run this command once for each package you wish to remove, substituting the full package name for
[APPX]. You may consider scripting this step as described in Removing AppX Packages with PowerShell.
> Remove-AppxProvisionedPackages -Path "C:\Imaging\Mount" -PackageName [APPX]
Unmount the Image
Dism /Unmount-Image /MountDir:"C:\Imaging\Mount" /Commit
Create Custom ISO
> oscdimg.exe -u2 -udfver102 -t -lCustom-Windows -bC:\Imaging\DVD\efi\microsoft\boot\efisys.bin C:\Imaging\DVD\ C:\Imaging\ISO\Custom-Windows.iso
Here’s a breakdown of this command:
|Produces an image containing only the UDF file system|
|Writes UDF revision 1.02|
|Specifies the El Torito load segment|
|Specifies the volume label|
|Specifies the path to the file that will be written to the boot sector|
|Path containing the source files|
|Output location for ISO file|
Now you should have
C:\Imaging\ISO\Custom-Windows.iso that you can write to DVD or to USB media using Rufus or balenaEtcher. Depending on the information you included in your answer file, you may have created a hands-free way to deploy your desired Windows configuration.