Deployment Image Servicing and Management (DISM) is a tool which allows you to service your images offline. It supports both .wim and .vhd formats. In this article, we will look at how do you mount an Wim Image using this tool!
DISM has a very constent syntax. If you are not aware of the syntaxes, then just type the below command in the cmd window. You will get an excellent help document, with examples too.! cmd:> DISM /?
You can read the Introduction to Deployment Image Servicing and Management (DISM) here
For the demo purpose, i have extracted the iso image which comes in the dvd of Server 2008 r2. Once you extract the iso, and goto sources folder, you will see install.wim and boot.wim. The Wim image (install.wim) has all the editions of the operating system and it’s always using the index number, we figure out which flavour of the OS it represents!
Now lets look at a legacy way of viewing an image information; we all use Imagex to find these details, using the command “Imagex /info <path>image.wim”; When you run this command “imagex /info “C:\Server2008r2\Sources\install.wim“, you will see a lot of information ranging from the number of directories, files, Index number, major version number, minor version number..etc etc.
When you think about documentation, you really dont need to know so much of information. and its really really tough to identify the required information from this kinda output.
Let’s fetch the same information using DISM, using the command dism /get-wiminfo /Wimfile:<path>image.wim. You will get to see clear information about all the editions which is loaded on the particular wim image!
If you need more information on a particular edition of the Wim Image, all you need to do is to add the index number at the end of the command /Index:<indexnumber>.
Mounting a Wim Image
Mounting an image as easy as calling a wim image with a /Mount-Wim switch and the Index number on a command prompt. You generally will mount an image for offline servicing. Predominantly they are for patch tuesdays, adding the new patches, Adding or removing the drivers, Enable or disable windows fetaures like Firewall, Games etc.. You can run the below command to mount a Wim Image.
dism /Mount-Wim /WimFile:<Path>image.wim /Index:<indexnumber> /MountDir:<mountDir>
The image is mounted to a folder, now you can make all the customizations and modifications to it!
Displaying all Mounted Wim Images
DISM provides you options to load even multiple Wim images in different folders. For example, if you need to replicate your customized drivers to all the images, you can just copy the drivers from C:\Windows\System32\Drivers from one image to another one which is currently build. You can just mount both these wim’s parallely and copy the drivers using the folder view.
This command will give you an overview on all the images which are mounted- dism /get-MountedWiminfo
You would also be interested in reading this -