DISM is a powerful command line for online or WIM file edit.

 

  • Find the index number for the version of windows you want to mount:

dism /get-imageinfo /imagefile:install.wim

  • Mount the wim file to a folder
    dism /mount-image /imagefile:install.wim /index:4

 

 

Inject driver to a boot image:

 

Preparation:

Warning: You should back up your Boot.Wims before making any changes that may impact their functionality.
 

  1. Create the following folders on the root of the C drive:
    • C:\Mount
    • C:\Mount\Drivers
    • C:\Mount\BootWIM
  2. Copy the drivers you wish to inject into the C:\Mount\Drivers folder
  3. Copy boot.wim to the C:\Mount folder.

Execution:

  1. Open a CMD prompt as Administrator.
  2. Navigate to “C:\Mount”.
  3. Use the following DISM commands to mount the Boot_x64.wim:
    • DISM /Mount-Wim /WimFile:C:\Mount\boot_x64.wim /Index:1 /MountDir:C:\Mount\BootWIM
  4. Use the following DISM command to add the driver(s):
    • DISM /Image:C:\Mount\BootWIM /Add-Driver /Driver:C:\Mount\Drivers /recurse
  5. Use the following DISM command to unmount the Boot.wim:
    • DISM /Unmount-Wim /MountDir:C:\Mount\BootWIM /Commit