Mounting and Editing Windows Image files

How to mount and edit Windows Image (WIM) files using ImageX and DISM.
From time to time you might need to make some very basic changes to your custom WIM files that you deploy using either Windows Deployment Services (WDS) or Microsoft Deployment Toolkit (MDT) so instead of having to re-capture a new image from a reference machine you can mount the WIM file and browse the OS folder structure and even load it’s Registry.
Firstly you need to have the ImageX command installed on your machine which is included with the Windows Automated Installation Kit (WAIK) for Windows 7 or Windows Assessment and Deployment Kit (ADK) for Windows 8.
Then you need to create a new folder as a mount point for the WIM file. In most cases C:\Mount will suffice, the active user needs write access to that folder or the image won’t mount.
Run theĀ Deployment Tools Command PromptĀ as Administrator and run the following command to mount a WIM:
imagex /mountrw “PATH TO WIM FILE” 2 c:\Mount
At this point the OS file structure of the WIM file will be accessible inside the C:\Mount folder. You add/remove files or add drivers.
To add drivers to the WIM file use the following command:
Dism /Image:C:\Mount /Add-Driver /Driver:”PATH TO FOLDER WITH DRIVER FILES” /Recurse
the /Recurse flag will add the drivers contained with the given folder.
Before unmounting any WIM files make none of the files contained within it are open in other applications or that C:\Mount itself is open in Windows Explorer.
Use the following command to unmount the WIM file:
imagex /unmount /commit c:\Mount
the /commit flag saves any changes made to WIM file while it was mounted, this can be removed if you wish to discard any changes.