
Create a custom Windows ISO image
I wrote last week about adding / enabling or removing / disabling Windows optional features on USB-based install media. You can read that story here: PS Scripting – USB install media: Add or Remove Windows Features
But, what to do when you wish to do the same using an ISO image? No problem: simply mount a Windows ISO image as a virtual DVD drive (right click, select Mount), copy its contents, all files and folders, to a folder on an HDD or SSD, mount its WIM image for offline servicing, enable or disable features, save those changes and create a new ISO image. The problem is, Windows does not have a native tool to write / create ISO files. There are a lot of third party options available to do the job, but for a Windows purist like me who tries to avoid third party tools as much as possible, that’s not an option.
As per my strict principles, I only use third party tools when there is no Windows native command to do something. When no native Windows command or tool is available, I’ll check if Microsoft has a tool available for free download. Only when these two options fail, I will try to find the simplest possible third party tool.
As mentioned, writing an ISO file is not possible using native Windows tools and commands. Luckily, Microsoft offers a free tool called OSCDIMG.EXE as optional download, as part of the Deployment Tools in the Windows 10 Assessment and Deployment Kit (WADK).
Download WADK. Accept the defaults, or if you only need OSCDIMG.EXE to create ISO images, unselect everything else, leaving only the Deployment Tools selected:

Accepting defaults is an almost 7 GB download, whereas only selecting Deployment Tools is under 70 MB.
WADK Deployment Tools include everything you need to capture a Windows image, deploy it, and, what’s important to us now, to write ISO images.
OK, we have copied the Windows Setup files from an ISO image into a folder, mounted and customized a Windows image, saved those changes, and now the folder contains an updated Windows image. Let’s make a bootable Windows ISO image, using the contents of the folder as the source. First, we must open an elevated Deployment and Imaging Tools Environment tool, a special Command Prompt mode. You’ll find it in Start > W > Windows Kits, right click Deployment and Imaging Tools Environment, select More and select Run as administrator:

The prompt is quite long, showing the full path to the tool. To shorten it, jump to root of the drive with command CD \ (#1 in next screenshot). Enter following command to create an ISO image from contents of a folder containing Windows Setup files (#2 in next screenshot):
oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,bD:\iso_files\boot\etfsboot.com#pEF,e,bD:\iso_files\efi\microsoft\boot\efisys.bin D:\iso_files D:\20H2x64.iso

For this example, I have the files copied from the ISO in folder D:\ISO_Files (green and blue highlights in command sample). Notice the two green highlights: there’s no space in between switch B and path to folder. The blue highlight is path to same folder, red highlight the path and name for new ISO image that will be created.
That’s it. Creating an ISO image file without third party tools is both easy and fast.
Kari
Author: Kari Finn
A former Windows Insider MVP, Kari started in computing in the mid 80’s writing code for VAX / VMS systems. Since then, he’s worked in a variety of IT positions. He specializes in Windows image capture, customization, repair and deployment as well as Hyper-V virtualization. Kari is a proud Team Member at number #1 Windows site TenForums.com.