Deployment Image Servicing and Management Deployment Image Servicing and Management (DISM) is a command-line

Deployment Image Servicing and Management Deployment Image Servicing and Management (DISM) is a command-line

tool that is used to service and manage Windows images. You can use it to install, uninstall, configure, and update Windows features, packages, drivers, and international settings.

CHAPTER 2: Installing, Upgrading, and Migrating to Windows 7

DISM can also be used to service Windows PE images. DISM is installed with Windows 7 and is also distributed in Windows OPK and Windows AIK. It is a consolidated tool that replaces several tools such as PEimg, Intlcfg, and Package Manager used in Windows, with added functionalities to improve the experience for offline servicing.

You can use DISM to: . Add, remove, and enumerate packages and drivers . Enable or disable Windows features . Apply changes based on the offlineServicing section of an unattend.xml

answer file . Configure international settings . Upgrade a Windows image to a different edition . Prepare a Windows PE image . Take advantage of better logging . Service all platforms (32-bit, 64-bit, and Itanium), service a 32-bit image

from a 64-bit host, and service a 64-bit image from a 32-bit host . Use old Package Manager Scripts

The base syntax for nearly all DISM commands is the same. After you have mounted or applied your Windows image so that it is available offline as a flat file structure, you can specify any DISM options, the servicing command that updates your image, and the location of the offline image. You can use only one servicing command per command line. If you are servicing a running computer, you can use the /Online option instead of specifying the location of the offline Windows Image.

The base syntax for DISM is the following:

DISM.exe {/Image: path_to_image | /Online} [dism_options] { servicing_command} [servicing_argument]

The following DISM options are available for an offline image:

DISM.exe /image: path_to_offline_image_directory [/WinDir: path_to_%WINDIR%] [/LogPath:path_to_log_file.log] [/LogLevel: n] [SysDriveDir:path_to_bootMgr_file] [/Quiet] [/NoRestart] [/ScratchDir: path_to_scratch_directory]

Deploying Windows 7

The following DISM options are available for a running operating system:

DISM.exe /online [/LogPath: path_to_log_file] [/LogLevel:n] [/Quiet] [/NoRestart] [/ScratchDir: path_to_scratch_directory]

Before you start working with an image, you need to retrieve information about the OS images that are contained within a WIM file. Do this with the following command:

dism /Get-WimInfo /WimFile:d:\sources\install.wim

If you add the command-line option /index plus the image’s index number, you get information about a specific image, such as the OS version, size, installed service pack, and so on:

dism /Get-WimInfo /WimFile:d:\sources\install.wim /index:4

Before you can work with a WIM image, you have to mount it to a folder with the following command:

dism /Mount-Wim /wimfile:c:\wim\install.wim /index:4 /MountDir:c:\img

If you need to mount an image onto a DVD or if you want to access the image in read-only mode, you just have to add /ReadOnly to the command.

After you have mounted an image, you can navigate through its folder struc- ture using Windows Explorer and make changes to all files and folders. In most cases, however, you use DISM to gather specific information about an image and also to add features, drivers, and packages.

To list all installed third-party drivers in the image mounted to c:\img, you execute the following command:

dism /image:c:\img /Get-Drivers

To add the driver (INF) file to the image in the mount directory, you execute the following command:

dism /image:c:\img /add-driver /driver: C:\drivers\driver.INF

To dismount the image, execute the following command:

dism /unmount-wim /mountdir:c:\img /discard

For more information about the Deployment Image Servicing and Management program, visit the following websites:

http://technet.microsoft.com/en-us/library/dd744256(WS.10).aspx http://technet.microsoft.com/en-us/library/dd744382(WS.10).aspx

CHAPTER 2: Installing, Upgrading, and Migrating to Windows 7