In this blog I will explain how to add the latest WinPE driver to the boot.wim image of your Windows 10 image via DISM.
I have written a previous blog about “How to build a Windows PE boot image” via SCCM, but what if you are not using SCCM, MDT or any other 3rd party tool? In this case you can use the Deployment Image Servicing and Management (DISM.exe) command-line tool.
Here are the steps to add the latest WinPE drivers to a boot.wim file via the DISM command-tool.
Step 1: Install Windows ADK
Download and install the latest Windows Assessment and Deployment Kit (ADK).
Download link: Windows Assessment Deployment Kit
Install the following features from the Windows ADK.
- Deployment Tools
- Imaging And Configuration Designer (ICD)
- Configuration Designer
- User State Migration Tool (USMT)
Step 2: Download the WinPE driver pack
In this step we will be downloading and preparing the WinPE driver pack which we will be adding to our boot.wim file. You can download the WinPE driver pack from any hardware vendor like Dell, HP or Lenovo. If you add one of these WinPE driver packages to your boot image you can boot most of the hardware that is currently available.
Download the driver pack from one of these locations:
Dell : Dell Driver Packs
HP : HP Driver Packs
Lenovo: Lenovo Driver Packs
In my case I downloaded the current WinPE 10 from Dell.
Extract the driver cab and copy it to your Windows source location. In my case that will be C:\WindowsSources\10\1909\Drivers\WinPe
Step 3: Mount the boot.wim file
I will be mounting my boot.wim file from my WindowsMedia folder. C:\WindowsMedia.
The boot.wim file contains two image files. You have to inject the driver pack into both images. (index:1 and index:2)
Start the Deployment and Imaging Tools Environment with “Run as Administrator” rights.
- Mount the Windows Setup boot image (index:1)
1 |
DISM /Mount-Image /ImageFile:"C:\WindowsMedia\sources\boot.wim" /index:1 /MountDir:"C:\Mount\Boot" |
Step 4: Inject the WinPE drivers into boot.wim index:1
In this step we will be injecting the WinPE drivers.
- Add the WinPE drivers to the mounted boot image (use the recurse switch to loop through all driver subfolders)
1 |
DISM /Image:C:\Mount\Boot /Add-Driver /Driver:C:\WindowsSources\10\1909\Drivers\winpe /recurse |
- Unmount the boot image index:1 and commit the changes
1 |
DISM /UnMount-Image /MountDir:"C:\Mount\Boot" /Commit |
Step 5: Inject the WinPE drivers into boot.wim index:2
Repeat the steps from step 3 and 4 for boot.wim index:2.
- Mount the Windows Setup boot image (index:2)
1 |
DISM /Mount-Image /ImageFile:"C:\WindowsMedia\sources\boot.wim" /index:2 /MountDir:"C:\Mount\Boot" |
- Add the WinPE drivers to the mounted boot image (use the recurse switch to loop through all driver subfolders)
1 |
DISM /Image:C:\Mount\Boot /Add-Driver /Driver:C:\WindowsSources\10\1909\Drivers\winpe /recurse |
- Unmount the boot image index:2 and commit the changes
1 |
DISM /UnMount-Image /MountDir:"C:\Mount\Boot" /Commit |
Step 6: Start deploying your new hardware with Windows 10
Copy your new boot.wim file to your deployment media and start deploying your hardware with Windows 10 that supports all the latest hardware drivers.
Happy deploying…. 😉
Thank you! it worked. I had to inject the drivers (Hard Drive Only) into the first “container” >index:1.
Index:2 reported “the container does not exist”. But It worked regardless
These are the following commands I used to add the drivers to my WinPE image.
Mounting the drive:
Dism /Mount-Image /ImageFile:”C:\WinPE_amd64\media\sources\boot.wim” /index:1 /MountDir:”C:\WinPE_amd64\mount”
Download the needed drivers and placed them all in 1 folder (C:\Drivers\WinPE)
Then run the following command to install the needed drivers
Dism /Add-Driver /Image:”C:\WinPE_amd64\media\sources\boot.wim. /Driver:”C:\Drivers\WinPE” /recurse
Then unmount the drive
Dism /Unmount-Image /MountDir:”C:\WinPE_amd64\mount” /commit
and flash to your USB
MakeWinPEMedia /UFD C:\WinPE_amd64 F: (F is your USB drive letter )_
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-mount-and-customize
Man I was looking all over the internet for a guide on how to do this and yours was definitely the most well written and easy to understand. Thanks you so much!
I am also here to report the same as Alex. Injecting the drivers only in index:1 worked. I thought it would not work because I got “the container does not exist” for index:2 but in the end I still gave it a try. Popped in the USB drive and the drivers were preloaded in WinPE.