- 19 Nov 2021
- 1 Minute to read
How to inject drivers into a Windows installation ISO
- Updated on 19 Nov 2021
- 1 Minute to read
Some servers may have hardware that isn't automatically recognized by Windows. If you're installing Windows to many of these systems, you may want to save time by creating a custom installation ISO that contains the required drivers.
To do this, you will need to already have 'Deployment and Imaging Tools Environment' installed. This can be downloaded directly from Microsoft, here: https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install
Steps to add drivers to a Windows installation ISO
- Create a C:\temp\ directory.
- Inside this directory, create the following folders: "drivers", "wim", "WindowsISO", "CustomISO"
- Copy the drivers you want to add to the ISO to the "drivers" folder you just created. You can create sub-folders for each driver if you want to keep things organized. The driver files will usually be in the form of .inf, .sys, and .cat files. Example below:
- Extract your Windows installation ISO to C:\temp\WindowsISO. You can do this with WinRAR, or 7zip for example. It should look like this if done correctly:
- Launch the 'Deployment and Imaging Tools Environment' application 'as Administrator'.
- Mount the install.wim file to c:\temp\wim using the imagex command. For windows server ISOs, the install wim will usually contain 4 images. 1: Standard Edition, 2: Standard Edition (Desktop Experience), 3: Datacenter Edition, 4: Datacenter Edition (Desktop Experience). In this example we will add the drivers to image number 1. Change the number depending on which image you want to add the drivers to.
imagex /mountrw c:\temp\WindowsISO\sources\install.wim 1 c:\temp\wim
- Add the drivers to the wim folder using the dism command:
dism /image:C:\temp\wim /add-driver /driver:C:\temp\drivers\ /recurse
- Once the drivers are added we need to commit the changes and unmount the wim folder:
imagex /unmount /commit C:\temp\wim
- We can now create the Installation media using the oscdimg command:
oscdimg -n -m -bc:\temp\WindowsISO\boot\etfsboot.com C:\temp\WindowsISO C:\temp\CustomISO\MyCustomWindowsInstaller.iso
Now you can use the ISO you created (which will now be inside c:\temp\CustomISO), and the windows installer will automatically install all the drivers for you.
Hopefully, this will save you a lot of time if you need to install multiple servers.
There are also other methods to achieve the same outcome, for example using powershell: https://www.thomasmaurer.ch/2019/07/add-drivers-to-a-windows-server-2019-iso-image/
Or using a third party tool such as PowerISO: https://www.poweriso.com/tutorials/add-driver-to-wim-file.htm