SERVICE WINDOWS 7 IMAGE USING
DISM
Image
For the purpose of this demo, we will be working on image which we will get from
the Windows 7 installation DVD. In our case we have copied install.wim image
from the Windows 7 installation DVD ([DVD drive]:\sources\install.wim) to
the C:\images\ folder. In that folder we have also created the 'mount' folder which
we will use to mount our image.
Image 204.1 - Folders
Next we need to open Deployment Tools Command Prompt with elevated
privileges. To do that go to Start > All Programs > Microsoft Windows AIK >
Deployment Tools Command Prompt (Deployment Tools Command Prompt
comes with WAIK for Windows 7).
Mounting
Next we will mount our image. To do that we will enter the following
command: dism /mount-wim /wimfile:c:\images\install.wim /index:5
/mountdir:c:\images\mount. 'DISM' means that we are using DISM to mount our
image. /mount-wim parameter means that we want to mount existing image.
With /wimfile parameter we specify the location of our image.
With /index parameter we specify which edition we want to mount (Ultimate in
our case). With /mountdir parameter we specify where do we want to mount our
image.
Image 204.2 - Mounting in Progress
Working with Features
Once our image is mounted we will check features that are available on our
mounted image. To do that we will use the following command: dism
/image:c:\images\mount /get-features. The /image parameter is used to specify
the location of our mounted image. The/get-features parameter is used to check
for available features.
Image 204.3 - Available Features List
Different editions of Windows will have different features available. Among other
things we have a feature that is called Minesweeper. This is a game that is
available for free in Windows and it is currently enabled. Let's gather more
information about that feature. We will use the following command: dism
/image:c:\images\mount /get-featureinfo /featurename:Minesweeper.
Remember that feature names are case-sensitive.
Image 204.4 - Minesweeper Feature
Now we will disable that feature. To do that we will enter the following
command: dism /image:c:\images\mount /disable-feature
/featurename:Minesweeper.
Image 205.5 - Feature Disabled
If we want to enable some feature we can use the /enable-feature option. In our
case Minesweeper is disabled on our mounted image so it will not be available by
default once we install our Windows 7 Ultimate edition. We can run the dism
/image:c:\images\mount /get-features command to check for available features
again. Notice that the status of the Minesweeper feature is now 'Disable Pending'.
Image 204.6 - Feature Status
Changing the Time Zone
We will change our time zone to the Central European Standard Time. To set the
time zone we will use the following command: dism /image:c:\images\mount
/set-timezone:"Central European Standard Time". For a complete list of time-
zone strings see the Unattend Setup Reference or use the tzutil command with the
'/l' parameter on a running Windows 7 machine.
Image 204.7 - TZUTIL
Image 204.8 - Time Zone Changed
Adding Drivers
We have added a new folder called 'addons' to the C:\images\ folder. Here we have
copied the driver that we want to add to the image driver store. In our case we want
to add drivers for Samsung ML1640 printer.
Image 204.9 - Samsung Drivers
To add our driver we will run the following command: dism
/image:c:\images\mount/adddriver:"C:\images\addons\SamsungML1640\ssp2
m.inf". Notice when specifying the path to our drivers, we also specified the Setup
Information file (.inf extension). In our case that file is ssp2m.inf.
Image 204.10 - Driver Installed
Driver content has been copied to the driver store successfully. If we enter the
command dism /image:c:\images\mount /get-drivers, we can see all third party
drivers installed in our image.
Image 204.11 - List of Drivers
Notice that our new driver now has a published name: oem1.inf. Below that we
can see the original file name (sspm.inf), class name (Printer), provider name
(Samsung), date and version.
Unmounting Image
We have made all changes that we wanted so we are ready to unmount our image.
To do that we will enter the following command: dism /unmount-wim
/mountdir:c:\images\mount /commit. Be sure to exit folder that is used for
mounting in Explorer.
Image 204.12 - Unmounting Successfull
Notice the /commit parameter. It is used to save all changes that we made to our
image. If we don't want to save changes can use the/discard parameter.
Remember
Using DISM we can service existing images. Before we can do anything we have
to mount our image. After that we can work with features, drivers, etc. DIMS
commands are not case sensitive, but feature names are.
Commands that are mentioned in this article
dism /mount-wim /wimfile:c:\images\install.wim /index:5
/mountdir:c:\images\mount - mount 'install.wim' image which is located in
'c:\images\' folder, edition with index number 5 (which is Ultimate), to the
'c:\images\mount' folder
dism /image:c:\images\mount /get-features - check features on mounted
image located in 'c:\images\mount' folder
dism /image:c:\images\mount /get-featureinfo /featurename:Minesweeper -
get detailed information about 'Minesweeper' feature on mounted image located
in 'c:\images\mount' folder
dism /image:c:\images\mount /disable-feature /featurename:Minesweeper -
disable 'Minesweeper' feature on mounted image which is located in
'c:\images\mount' folder
dism /image:c:\images\mount /set-timezone:"Central European Standard
Time" - change the time zone of the mounted image located in
'c:\images\mount\' folder to the 'Central European Standard Time'
tzutil /l - see a complete list of time-zone strings (enter in Command Prompt)
dism /image:c:\images\mount /add-
driver:"C:\images\addons\SamsungML1640\ssp2m.inf" - add 'ssp2m.inf'
driver to the mounted image located in 'c:\images\mount' folder
dism /image:c:\images\mount /get-drivers - see all third party drivers
available on mounted image
dism /unmount-wim /mountdir:c:\images\mount /commit - unmount image
and commit all changes
Paths that are mentioned in this article
[DVD drive]:\sources\install.wim - image location on the Windows 7
installation DVD
C:\images\ - folder in which we have copied install.wim image
C:\images\mount\ - folder which we used to mount our image
Source: http://www.utilizewindows.com/7/deployment/204-service-windows-7-
image-using-dism