Modify WinPE Images Using DISM

If you read our previous article PXE Boot Almost Any ISO Image, then you will note in that article we detailed the steps to boot Macrium Reflect 6.0 over PXE. While it was not discussed in that article, Macrium Reflect Rescue media is WinPE based. The important takeaway here is that you are not stuck with the drivers that came pre-loaded from the software manufacturer. So essentially, if you have machines that have newer drivers than your boot media, you can simply add the new drivers yourself. In this article we will be modifying the boot.wim that is created by the Macrium Bootable Rescue Media Creator. When creating bootable media the first time in Macrium Reflect, you will be prompted with the following dialog. macrium-winpe-selectYou can select any environment you wish here because you have the option to change it later. Depending on which environment you select, just prior to finishing the wizard you will be prompted to allow downloading the WinPE environment from Microsoft. Now, finish creating the media. Once the media is created for the first time, you will have a new folder on your system drive which in my case is C:\boot. This folder contains all the files Macrium needs to create your bootable media. We will want to get a copy of the source wim image by navigating to C:\boot\macrium\WA5KFiles\media\sources and copying theĀ boot.wim to a folder of your choice to use as a working environment to modify the image. In our case we have created the following folder structure as our working environment. It certainly is not required, but I would highly recommend creating the below folder structure so the included batch scripts can be used to inject your drivers into your image. Next you will want to winpe-envcopy the boot.wim to the sources directory as seen below. Then copy any driver you wish to inject into the image into the drivers folder in its own sub folder as seen below.winpe-drivers-env Notice that we are including the pvscsi and vmxnet3 VMWare drivers so our boot media can be used in our ESXi environment. Once the drivers are in place, all that is left to do is place the three batch files included in the download below in the WinPE folder or simply download and extract the package to build your environment.


If working with multiple PE versions, this script can easily be extended to prompt for the environment you wish to mount as seen below. Note this method requires that the boot.wim be renamed based on version.



Note it is important to run the batch files in the following order. First, run mount.bat in order to mount the image for offline servicing. Next, run drivers.bat to inject your custom drivers into the offline image. Lastly, run umount.bat in order to save the offline image. That is it! Once you have completed those steps, simply copy the new boot.wim image back to C:\boot\macrium\WA5KFiles\media\sources and re-run the Macrium Bootable Rescue Media Creator.

download-icon WinPE Environment Download

Did you find this article useful? Why not share it with your friends?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.