
Information
Servicing an offline image, mounting an image, committing changes, it all sounds a bit complicated to an average Windows user. However, it's just geek speak meaning modifying default Windows install image, the install.wim file. It is a straight forward procedure. When changes have been committed (written, saved) to image, the modified install.wim can be used to deploy Windows or to replace original install.wim on existing install media.
Servicing an offline image is done with DISM (Deployment Image Servicing and Management), a native Windows tool. DISM command options allow all kind of changes, changing the way Windows will be installed. Drivers can be added or removed, language packs applied to create a multilingual Windows install media, Windows Updates applied to get a new Windows installation to be up to date straight after installation, and so on.
A default Windows install media is hardware independent, meaning that it can be used to install Windows on any hardware capable of running Windows. Windows will be installed with default drivers, then after the installation Windows Update searches for correct drivers installing them or the user installs drivers manually using ones provided by manufacturer.
If the install media will be used on specific hardware, you can shorten the time required to install Windows, as well as time required for post install update by adding hardware specific drivers to install media.
This tutorial will show how to use DISM to add or remove drivers on an offline image of Windows.
Contents
Use links below to go to any step, back button of your browser to return to this list.

Note
Steps One & Two will show both available methods to get drivers to be added to image. Usually you would need to use one of the methods to get correct drivers, download drivers from manufacturer's site or export drivers from an existing Windows 10 installation on exactly the same hardware. However, there's nothing to prevent using both methods; you could for instance export drivers from an existing Windows installation on similar but not exactly the same hardware setup, then remove drivers that are different on hardware where your install media will be used and download those drivers from manufacturer's site.
Exporting drivers from an existing installation on same hardware is my preferred method. Exporting the full set of drivers and adding them to offline image is very practical especially for private users who want to make an install media for their own hardware. A reinstall using such media is as easy as it can be, providing a complete Out-of-Box Windows installation without any need to start installing hardware drivers after the installation.
Step One
Get drivers: Download
1.1) Download required drivers from manufacturer's site
1.2) Most often the drivers come as a self-extracting executable (.exe) or archived (.zip) file. You must extract drivers first, an archive file can't be used. To be able to add an individual driver, you will need its .inf file
Step Two
Get drivers: Export
2.1) Create a new folder for exported drivers, in this example I'll make it as
D:\Drivers
2.2) To export all hardware drivers from an existing Windows 10 installation, use following command in elevated PowerShell (
tutorial), replacing path
D:\Drivers with your actual path:
dism /Online /Export-Driver /Destination:D:\Drivers
Drivers will be exported to your chosen folder:

Step Three
Mount Offline Image
3.1) Create a new folder to temporarily store the contents of Windows 10 ISO image, name it as you want to. In this example I create the folder on drive
D: naming it
ISO_Files.
3.2) Mount a Windows 10 ISO image as virtual DVD by double clicking it, alternatively right clicking it and selecting
Mount. Open mounted ISO in
Explorer, select all files and folders with
CTRL + A and copy them with
CTRL + C, paste the ISO content to
ISO_Files folder with
CTRL + V:

Note
If you have Windows 10 install media on a USB flash drive, you can skip steps 3.1 & 3.2 and use it instead.
3.3) Create a folder to mount offline image. In this example I use folder
C:\Mount.
3.4) Open
elevated PowerShell (
tutorial). Enter following command to check what editions are included in image:
Dism /Get-WimInfo /WimFile:D:\ISO_Files\Sources\install.wim
Note the index number of your selected edition. In this example I have copied all content of
Windows 10 Fall Creators Update version 1709 to
ISO_Files folder. I want to use
PRO edition to add drivers to it, noting its index number
8:
3.5) Mount the image of your preferred Windows 10 edition using it's index number, index 8 in this example:
Dism /Mount-Image /ImageFile:D:\ISO_Files\Sources\install.wim /Index:8 /MountDir:C:\Mount
Notice please: you can also mount and service a virtual hard disk (VHD or VHDX file). When mounting a VHD file, index number is always 1. Set
/ImageFile as path to virtual hard disk file, for instance mounting a VHDX file named
W10PROx64.vhdx which is stored in folder
F:\VHD_Files, you would use the following mount command:
Dism /Mount-Image /ImageFile:F:\VHD_Files\W10PROx64.vhdx /Index:1 /MountDir:C:\Mount
This will take some time. Please notice, the drive where the
Mount folder is located needs some free space. I do not recommend mounting a WIM image to a folder on a drive with less than 15 GB free space. For instance, mounting the multi edition build 16299.15 image requires almost 12 GB, in addition to space required to work with the image:

Mounting a VHD / VHDX file requires at least as much free space on drive where Mount folder is located as is the size of the virtual hard disk. If you mount a dynamically expanding 64 GB virtual hard disk to be serviced, you need at least 70 GB free space.
Step Four
Add drivers to image

Note
You can always check which drivers are already present in offline image with following command:
Dism /Image:C:\Mount /Get-Drivers
4,1) If you downloaded individual drivers, you can add them now to offline mounted image with following command:
dism /Image:C:\Mount /Add-Driver /Driver:X:\Drivers\DriverName.inf
Replace mount folder path
C:\Mount in above sample command with actual path to your mount folder, and driver path and name
X:\Drivers\DriverName.inf with actual path to downloaded driver
4.2) If the driver is unsigned, use the following command:
dism /Image:C:\Mount /Add-Driver /Driver:X:\Drivers\DriverName.inf /ForceUnsigned
4.3) If you want to remove a driver from offline image, use the following command:
dism /Image:C:\Mount /Remove-Driver /Driver:X:\Drivers\DriverName.inf
4.4) With
/Add-Driver and
/Remove-Driver you can add or remove multiple drivers:
dism /Image:C:\Mount /Add-Driver /Driver:X:\Drivers\DriverName.inf /Driver:X:\Drivers\Driver2Name.inf
4.5) If you have drivers on one folder and its subfolders, like for instance when exported from an existing installation, you can add all drivers with one simple command, replacing mount folder and drivers folder paths with your actual paths:
dism /Image:C:\Mount /Add-Driver /Driver:D:\Drivers /Recurse
/Recurse switch will tell PowerShell to go through the main folder and its subfolders, adding all drivers it finds:

(Click to enlarge.)
Step Five
Unmount offline image
5.1) All done, you can save changes and unmount offline image with following command:
dism /Unmount-Image /MountDir:C:\Mount /Commit
The
/Commit switch is the important one, it commits (saves) all changes to the image.
Step Six
Create updated ISO
That's it! If you have any issues with this, do not hesitate to post in this thread.
Kari