Export (0) Print
Expand All
7 out of 9 rated this helpful - Rate this topic

DISM Command-Line Options

You can use Deployment Image Servicing and Management (DISM.exe) to install, uninstall, configure, and update the features and packages offline for Windows® images and Windows Preinstallation Environment (Windows PE) images. The commands and options that you can use to service an image depend on which Windows operating system you are servicing (Windows® 7, Windows Vista® with Service Pack 1 (SP1), Windows Server® 2008 R2, Windows Server® 2008, or Windows PE) and whether the image is offline or online. All commands work on an offline Windows image. Subsets of the commands are available for servicing an online Windows installation.

The DISM command-line options are global and can be used with most servicing command-line options, but the servicing command-line options work individually and cannot be used in combination with other servicing command-line options. A Windows image is made available for servicing by mounting the image or specifying an online Windows installation.

DISM consolidates the functionality of several Windows OEM Preinstallation Kit (Windows OPK) tools, including PEImg, Intlcfg, and Package Manager.

For an online demonstration of DISM, see Deployment Image Servicing and Management.

DISM Command-Line Options

To service an offline Windows image, you must first mount the image. You can use Windows image (WIM) commands and arguments to mount a WIM image for servicing and management. You can also use these commands to list the indexes or to verify the architecture for the image you are mounting. After you update the image, you must unmount it and commit the changes you have made.

You can use the following commands to mount, unmount, or 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. Most operations that specify a WIM file require either an index or a name value.

If you want to set the mounted image as read-only, use the /ReadOnly command.

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 made to the mounted image.

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 you 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>

Remounts a mounted WIM file that has become inaccessible, and makes it accessible for servicing.

Example:

Dism /Remount-Wim /MountDir:<path_to_mount_directory>

/Cleanup-Wim

 

Deletes all of the resources associated with a mounted WIM image that has been abandoned. This command does not unmount currently mounted images, and it does not 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 file. When you use this with the /Index or /Name options, information about the specified image is displayed.

Example:

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

/Get-MountedWimInfo

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

Example:

Dism /Get-MountedWimInfo

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 as follows:

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>]

The following DISM options are available for an online Windows image:

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

The following table provides a description of how to use each DISM option. These options are not case sensitive.

 

Option Description

/Get-Help

/?

Displays information about the DISM command-line options and arguments that are available.

The options for servicing an image depend on the servicing technology that is available in your image.

Example:

Dism /?
Dism /image:C:\test\offline /?
Dism /online /?

You can display additional help by specifying a command-line option.

Example:

Dism /image: C:\test\offline /Add-Driver /?
Dism /image:C:\test\offline /Add-Package /?
Dism /online /Get-Drivers /?

/LogPath:<path to log file.log>

Specifies the full path and file name to log to. If not set, the default is %WINDIR%\Logs\Dism\dism.log.

ImportantImportant
In Windows PE, the default directory is the RAMDISK scratch space, which can be as small as 32 MB.

The log file is automatically archived, and the archived log file is saved with the .bak extension. Each time the log file is archived, a new log file is generated and the .bak file is overwritten.

When using a network share that is not joined to a domain, use the net use command with domain credentials to set access permissions before you set the log path for the DISM log.

Example:

Dism /image:C:\test\offline /LogPath:AddPackage.log /Add-Package /PackagePath:C:\packages\package.cab

/LogLevel:<n>

Specifies the maximum output level shown in the logs. The default log level is 3. The following values are accepted:

1 = Errors only

2 = Errors and warnings

3 = Errors, warnings, and information

4 = Errors, warnings, information, and debug output

Example:

Dism /image:C:\test\offline /LogPath:AddPackage.log /LogLevel:1 /Add-Package /PackagePath:C:\packages\package.cab

/Image:<path_to_offline_image_directory>

This is the full path to the root directory of the offline Windows image that you are servicing. If the Windows directory is not a subdirectory of the root directory, you must specify /WinDir.

This option cannot be used with /Online.

Example:

Dism /image:C:\test\offline /LogPath:AddPackage.log /LogLevel:1 /Add-Package /PackagePath:C:\packages\package.cab

/WinDir:<path_to_%WINDIR%>

Used with the /Image option to specify the path to the Windows directory relative to the image path. This cannot be the full path to the Windows directory; it should be a relative path. If not specified, the default is the Windows directory in the root of the offline image directory.

ImportantImportant
This is a relative path, not the full path to the Windows directory. If not specified, the default is the Windows directory in the root of the offline image directory.

This option cannot be used with the /Online option.

Example:

Dism /image:C:\test\offline /WinDir:WinNT /Add-Package /PackagePath:C:\packages\package.cab

/Online

Specifies that the action applies to the online Windows installation.

This option cannot be used with the /Image or the /WinDir options. When you use /Online, the Windows directory for the online image is automatically detected.

Example:

Dism /online /Get-Packages

/SysDriveDir:<path_to_sysdrive_directory>

Specifies the path to the BootMgr files. This is necessary only when the BootMgr files are located on a partition other than the one containing the Windows directory and when the BootMgr files need to be serviced.

This option is not necessary if you are servicing an applied image, because system partitions are not part of the WIM file.

Example:

Dism /image:C:\test\offline /SysDriveDir:C:\

/Quiet

Turns off information and progress output to the console. Only error messages are displayed.

To run in quiet mode, set this option every time you run the command-line utility, before you use the servicing command.

noteNote
Do not use the /Quiet option with /Get commands. No information will be displayed.

Example:

Dism /image:C:\test\offline /Add-Package /PackagePath:C:\packages\package.cab /quiet

/NoRestart

Suppresses reboot. If a reboot is not necessary, then this command does nothing. This option keeps the application from prompting for a restart, or keeps it from restarting automatically if you use the /Quiet option.

Example:

Dism /online /Add-Package /PackagePath:C:\packages\package.cab /NoRestart /quiet

/ScratchDir:<path_to_scratchdirectory>

Specifies a temporary directory to use when extracting files for temporary use during servicing. The directory must exist locally. If not specified, the \Windows\%Temp% directory will be used, with a subdirectory name of a randomly generated hexadecimal value for each run of DISM. Items in the scratch directory are deleted after each operation.

Do not use a network share location for a scratch directory to expand a package (.cab or .msu file) for installation. Use a local directory for extracting files for temporary usage during servicing.

Example:

Dism /image:C:\test\offline /ScratchDir:C:\Scratch /Add-Package /PackagePath:C:\packages\package.cab

/English

Displays command-line output in English.

noteNote
Some resources cannot be displayed in English.

This option is not supported when using the DISM /? command.

Example:

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

Servicing Command-Line Options

Depending on the image you have specified (Windows 7, Windows Vista with SP1, Windows Server 2008 R2, Windows Server 2008, or Windows PE) and whether the image is offline or an online Windows installation, servicing commands and arguments are available for some of the following types of updates:

noteNote
You cannot use two different types of servicing commands in the same command line.

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.