What is the Deployment Image Servicing and Management (DISM) Tool?

Deployment Image Servicing and Management (DISM) is a new command-line tool introduced for the Windows® 7 operating system that can be used to service a Windows image or to prepare a Windows Preinstallation Environment (PE) image. It replaces Package Manager (pkgmgr.exe), PEimg, and Intlcfg that were included in Windows Vista®. The functionality that was included in these tools is now consolidated in DISM, and new functionalities have been added to improve the experience for offline servicing.

DISM can be used to service Windows Vista® with Service Pack 1 (SP1) and Windows Server® 2008 and provides the same functionality that Package Manager provided. DISM provides additional functionality when used with Windows 7 and Windows Server 2008 R2.

You can use DISM to:

  • Add, remove, and enumerate packages.
  • Add, remove, and enumerate drivers.
  • Enable or disable Windows features.
  • Apply changes based on the offline servicing 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 down-level operating systems like Windows Vista with SP1 and Windows Server 2008.
  • 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.
  • Make use of old Package Manager scripts.

DISM Command-Line Options

To service a Windows image offline, it must be applied or mounted. For example, WIM images can be mounted using the Windows Image (WIM) commands within DISM, or applied and recaptured using ImageX.” You can also use these commands to list the indexes or verify the architecture for the image you are mounting. After you update the image, you must unmount it and either commit or discard the changes you have made.

The following commands can be used to mount, unmount, and query WIM files. These options are not case sensitive.

Option Argument Description

/Mount-Wim

/WimFile:<path_to_image.wim>

/index:<image_index>

/name:<image_name>

/MountDir:<path_to_mount_directory>

/ReadOnly

Mounts the WIM file to the specified directory so that it is available for servicing.

/ReadOnly sets the mounted image with read only permissions. Optional.

Note: An index or name value is required for most operations that specify a WIM file.

Example:

Dism /Mount-Wim /WimFile:C:\test\images\install.wim /index:1 /MountDir:C:\test\offline /ReadOnly

Dism /Mount-Wim /WimFile:C:\test\offline\install.wim /name:"Windows Vista HomeBasic" /MountDir:C:\test\offline

/Commit-Wim

/MountDir:<path_to_mount_directory>

Applies the changes you have made to the mounted image. The image remains mounted until the /unmount option is used.

Example:

Dism /Commit-Wim /MountDir:C:\test\offline

/Unmount-Wim

/MountDir:<path_to_mount_directory>

{/commit | /discard}

Unmounts the WIM file and either commits or discards the changes that were made while the image was mounted.

Example:

Dism /unmount-Wim /MountDir:C:\test\offline /commit

Dism /unmount-Wim /MountDir:C:\test\offline /discard

/Remount-Wim

/MountDir:<path_to_mount_directory>

Recovers an orphaned WIM mount directory.

Example:

Dism /Remount-Wim /MountDir:<path_to_mount_directory>

/Cleanup-Wim

Deletes all the resources associated with a mounted WIM image that has been abandoned. This command will not unmount currently mounted images, nor will it delete images that can be remounted.

Example:

Dism /Cleanup-Wim

/Get-WimInfo

/WimFile:<path_to_image.wim>

/index:<Image_index>

/name:<Image_name>

Displays information about the images within the WIM. When used with the /index option, information about the specified image is displayed.

Example:

Dism /Get-WimInfo /WimFile:C:\test\offline\install.wim /index:1

/Get-MountedWimInfo

/name:<image_name>

/MountDir:<path_to_mount_directory>

/ReadOnly

Lists the images that are currently mounted and information about the mounted image such as read/write permissions, mount location, mounted file path, mounted image index.

Example:

Dism /Get-MountedWimInfo

The base syntax for nearly all DISM commands is the same. After you have mounted your Windows image, you can specify any DISM options, the servicing command that will update your image, and the location of the mounted 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 mounted Windows image.

The base syntax for DISM is:

DISM.exe {/image:<path_to_image> | /online} [dism_options] {servicing_command} [<servicing_argument>]

Check out the online demonstration of DISM.