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. You 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 copy 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. 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.
mount.bat
@ECHO OFF ECHO Mounting Windows PE Offline Image dism /mount-wim /wimfile:sources\boot.wim /index:1 /mountdir:mount
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.
@ECHO OFF ECHO. ECHO 1 = Windows 10 PE Image ECHO 2 = Windows 8.1 PE Image ECHO. set /p input="Enter Selection: " IF "%input%"=="1" GOTO 10 IF "%input%"=="2" GOTO 81 GOTO End :10 ECHO Mounting Windows 10 Image dism /mount-wim /wimfile:sources\10boot.wim /index:1 /mountdir:mount GOTO End :81 ECHO Mounting Windows 8.1 Image dism /mount-wim /wimfile:sources\81boot.wim /index:1 /mountdir:mount GOTO End :End
drivers.bat
@ECHO OFF ECHO Injecting Drivers in Windows PE Offline Image dism /image:mount /Add-Driver /driver:drivers /recurse /forceunsigned
umount.bat
@ECHO OFF ECHO. ECHO 1 = Save Changes ECHO 2 = Discard Changes ECHO. set /p input="Enter Selection: " IF "%input%"=="1" GOTO Save IF "%input%"=="2" GOTO Discard GOTO End :Save ECHO Saving Windows PE Offline Image dism /unmount-wim /mountdir:mount /commit GOTO End :Discard ECHO Discarding Windows PE Offline Image dism /unmount-wim /mountdir:mount /discard GOTO End :End dism /cleanup-wim
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.