Using DISM to inject drivers in boot.wim

If you are deplyong Windows 7 from Windows Deployment Services you might run into the problem that you need drivers for a certain type of network card. If the driver is not available on the boot.wim image you have to use DISM to inject the driver in the image.

First of all you have to install the Windows AIK, which can be downloaded from the microsoft site. Install it on a so called technician pc and launch the Deployment Tools Command Prompt. Before we start you have to get yourself an untouched boot.wim file. It can be found on a Windows 7 product DVD in the sources directory.

Before we start, we’ll create a folder named bootimage in the root of the C drive, in the boot directory we will create a folder named mount. When this is done i’ll copy the boot.wim from the Windows 7 prodcut DVD into the c:\bootimage directory.It should look like this.

Now from the Deployment Tools command prompt we are going to mount the image.

DISM /Mount-Wim /WimFile:C:\bootimage\boot.wim /index:1 /MountDir:C:\bootimage\mount

Now the image is mounted we have to add the drivers. Before we do this let’s check which 3th party drivers are available.

DISM /Image:c:\bootimage\mount /get-drivers

So the basic boot.wim does not contain any 3th party drivers. Let’s add some Windows 7 network drivers to the image now. The /recurse switch in this command tells the DISM command to search all subdirectories and add the files nested into it in their own directory.

DISM /image:c:\bootimage\mount /Add-Driver /driver:E:\networkdrivers\PRO1000\Win32\NDIS62 /recurse

The drivers are installed now, let’s run the get-drivers command another time to see if something has really changed.

DISM /Image:c:\bootimage\mount /get-drivers

The drivers are installed, now we only need to save the image and unmount it. The /commit switch makes the changes to the image, you can use the /discard switch to unmount without saving the changes to the image

Dism /Unmount-Wim /MountDir:C:\bootimage\mount\ /Commit

You can now upload this image to the WDS server