Deployment Image Servicing and Management (DISM) Command-Line Options (Standard 8)

7/8/2014

Review the command-line options for Deployment Image Servicing and Management (DISM) in Windows Embedded 8 Standard (Standard 8).

Deployment Image Servicing and Management (DISM) installs, uninstalls, configures, and updates the features and CBS packages in offline Windows Embedded 8 Standard (Standard 8) images and offline Windows Preinstallation Environment (Windows PE) 4.0 images. The commands and options that are available for servicing an image depend on whether the image is offline or online. All commands work on an offline Standard 8 image. Subsets of the commands are available for servicing a running operating system.

The DISM command-line options are global and can be used with most servicing command-line options. The servicing command-line options work individually and cannot be used in combination with other servicing command-line options. A Standard 8 image is made available for servicing by mounting the image or specifying a running operating system.

Deployment Image Servicing and Management Command-Line Options

Before you can service an offline Standard 8 image, you must first mount a Windows image (.wim) file or virtual hard disk (.vhd or .vhdx). You can also use the DISM image management command to list the image index numbers or to verify the architecture for the image that you are mounting. After you update the image, you must unmount it and either commit or discard the changes that you have made.

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

Option

Argument

Description

/Append-Image

/ImageFile:<path_to_image_file>

/CaptureDir:<source_directory>

/Name:<image_name>

[/Description:<image_description>]

[/ConfigFile:<configuration_file.ini>]

[/Bootable]

[/CheckIntegrity]

[/Verify]

[/NoRpFix]

Adds an additional image to a .wim file. /AppendImage compares new files to the resources in the existing .wim file specified by the /ImageFile argument, and stores only a single copy of each unique file so that each file is only captured once. The .wim file can have only one assigned compression type. Therefore, you can only append files with the same compression type.

This command-line option does not apply to virtual hard disk (VHD) files.

JJ980032.note(en-us,WinEmbedded.81).gifImportant:
Ensure that you have enough disk space for the /Append-Image option to run. If you run out of disk space while the image is being appended, you might corrupt the .wim file.

/ConfigFile specifies the location of a configuration file that lists exclusions for image capture and compress commands.

/Bootable marks a volume image as being a bootable image. This argument is available only for Windows PE images. Only one volume image can be marked as bootable in a .wim file.

/CheckIntegrity detects and tracks .wim file corruption when used with capture, unmount, export, and commit operations. /CheckIntegrity stops the operation if DISM detects that the .wim file is corrupted when used with apply and mount operations.

/Verify checks for errors and file duplication.

/NoRpFix disables the reparse point tag fix. A reparse point is a file that contains a link to another file on the file system. If /NoRpFix is not specified, reparse points that resolve to paths outside of the value specified by /ImageFile are not be captured.

Dism /Append-Image /ImageFile:install.wim /CaptureDir:D:\ /Name:Drive-D

/Apply-Image

/ImageFile:<path_to_image_file>

[/SWMFile:<pattern>]

/ApplyDir:<target_directory>

{/Index:< image_index> | /Name:<image_name>}

[/CheckIntegrity]

[/Verify]

[/NoRpFix]

Applies an image to a specified drive.

This command-line option does not apply to virtual hard disk (VHD) files.

/SWMFile enables you to reference split .wim files (SWMs). <pattern> is the naming pattern and location of split files. You can also specify wildcard characters. For example, "E:\image\install*.swm" applies all of the split files in the E:\image directory named install1.swm, install2.swm, and so on.

/CheckIntegrity detects and tracks .wim file corruption when used with capture, unmount, export, and commit operations. /CheckIntegrity stops the operation if DISM detects that the .wim file is corrupted when used with apply and mount operations.

/Verify checks for errors and file duplication.

/NoRpFix disables the reparse point tag fix. A reparse point is a file that contains a link to another file on the file system. If /NoRpFix is not specified, reparse points that resolve to paths outside of the value specified by /ImageFile are not be captured.

Dism /apply-image /imagefile:install.wim /index:1 /ApplyDir:D:\
Dism /apply-image /imagefile:install.swm /swmfile:install*.swm /index:1 /applydir:D:\

/Capture-Image

/ImageFile:<path_to_image_file>

/CaptureDir:<source_directory>

/Name:<image_name>

[/Description:<image_description>]

[/ConfigFile:<configuration_file.ini>]

[/Compress:{max | fast | none}]

[/Bootable]

[/CheckIntegrity]

[/Verify]

[/NoRpFix]

Captures an image of a drive to a new .wim file. Captured directories include all subfolders and data. You cannot capture an empty directory. A directory must contain at least one file.

This command-line option does not apply to virtual hard disk (VHD) files.

JJ980032.note(en-us,WinEmbedded.81).gifImportant:
DISM does not support extended attributes. DISM ignores extended attributes during a capture operation.

/ConfigFile specifies the location of a configuration file that lists exclusions for image capture and compress commands.

/Compress specifies the type of compression used for the initial capture operation. The maximum option provides the best compression, but takes more time to capture the image. The fast option provides faster image compression, but the resulting files are larger than those compressed by using the maximum option. This is also the default compression type that is used if you do not specify the argument. The none option does not compress the captured image at all.

/Bootable marks a volume image as being a bootable image. This argument is available only for Windows PE images. Only one volume image can be marked as bootable in a .wim file.

/CheckIntegrity detects and tracks .wim file corruption when used with capture, unmount, export, and commit operations. /CheckIntegrity stops the operation if DISM detects that the .wim file is corrupted when used with apply and mount operations.

/Verify checks for errors and file duplication.

/NoRpFix disables the reparse point tag fix. A reparse point is a file that contains a link to another file on the file system. If /NoRpFix is not specified, reparse points that resolve to paths outside of the value specified by /ImageFile are not be captured.

Dism /Capture-Image /ImageFile:install.wim /CaptureDir:D:\ /Name:Drive-D

/Cleanup-Mountpoints

Deletes all of the resources associated with a mounted image that has been corrupted. This command will not unmount images that are already mounted, nor will it delete images that can be recovered using the /Remount-Image command.

Dism /Cleanup-Mountpoints

/Commit-Image

/MountDir:<path_to_mount_directory>

[/CheckIntegrity]

[/Append]

Applies the changes that you have made to the mounted image. The image remains mounted until the /Unmount-Image option is used.

/CheckIntegrity detects and tracks .wim file corruption when used with capture, unmount, export, and commit operations. /CheckIntegrity stops the operation if DISM detects that the .wim file is corrupted when used with apply and mount operations.

/Append adds the modified image to the existing .wim file instead of overwriting the original image.

The /CheckIntegrity and /Append arguments do not apply to virtual hard disk (VHD) files.

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

/Delete-Image

/ImageFile:<path_to_image_file>

{/Index:<image_index> | /Name:<image_name>}

[/CheckIntegrity]

Deletes the specified volume image from a .wim file that has multiple volume images. This option deletes only the metadata entries and XML entries. It does not delete the stream data and does not optimize the .wim file.

This command-line option does not apply to virtual hard disk (VHD) files.

/CheckIntegrity detects and tracks .wim file corruption when used with capture, unmount, export, and commit operations. /CheckIntegrity stops the operation if DISM detects that the .wim file is corrupted when used with apply and mount operations.

Dism /Delete-Image /ImageFile:install.wim /Index:1

/Export-Image

{/SourceImageFile:<path_to_image_file> | /SWMFile:<pattern>}

{/SourceIndex:<image_index> | /SourceName:<image_name>}

/DestinationImageFile:<path_to_image_file>

[/DestinationName:<name>]

[/Compress:{max | fast | none}]

[/Bootable]

[/CheckIntegrity]

Exports a copy of the specified image to another file. The source and destination files must use the same compression type. You can also optimize an image by exporting to a new image file. When you modify an image, DISM stores additional resource files that increase the overall size of the image. Exporting the image will remove unnecessary resource files.

This command-line option does not apply to virtual hard disk (VHD) files.

/SWMFile enables you to reference split .wim files. pattern is the naming pattern and location of split files. You can also specify wildcard characters. For example, "E:\image\install*.swm" will export the split files in the E:\image directory named install1.swm, install2.swm, and so on.

/Compress specifies the type of compression used for the initial capture operation. The maximum option provides the best compression, but takes more time to capture the image. The fast option provides faster image compression, but the resulting files are larger than those compressed by using the maximum option. This is also the default compression type that is used if you do not specify the argument. The none option does not compress the captured image at all.

/Bootable marks a volume image as being a bootable image. This argument is available only for Windows PE images. Only one volume image can be marked as bootable in a .wim file.

/CheckIntegrity detects and tracks .wim file corruption when used with capture, unmount, export, and commit operations. /CheckIntegrity stops the operation if DISM detects that the .wim file is corrupted when used with apply and mount operations.

Dism /Export-Image /SourceImageFile:install.wim /SourceIndex:1 /DestinationImageFile:install2.wim

/Get-MountedImageInfo

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

Dism /Get-MountedImageInfo

/Get-ImageInfo

/ImageFile:<path_to_image_file>

{/Index:<image_index> | /Name:<image_name>}

Displays information about the images that are contained in the .wim, vhd or .vhdx file. When used with the /Index or /Name argument, information about the specified image is displayed. The /Name argument does not apply to VHD files. You must specify /Index:1 for VHD files.

Dism /Get-ImageInfo /ImageFile:C:\test\offline\install.wim
Dism /Get-ImageInfo /ImageFile:C:\test\images/myimage.vhd /Index:1

/List-Image

/ImageFile:<path_to_image_file>

{/Index:<image_index> | /Name:<image_name>}

Displays a list of the files and folders in a specified image.

This command-line option does not apply to virtual hard disk (VHD) files.

Dism /List-Image /ImageFile:install.wim /Index:1

/Mount-Image

/ImageFile:<path_to_image_file>

{/Index:<image_index> | /Name:<image_name>}

/MountDir:<path_to_mount_directory>

[/ReadOnly]

[/Optimize]

[/CheckIntegrity]

Mounts an image from a .wim, .vhd or .vhdx file to the specified directory so that it is available for servicing.

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

You can use /Optimize to reduce initial mount time.

JJ980032.note(en-us,WinEmbedded.81).gifImportant:
When using the /Optimize argument, processes that are ordinarily performed during a mount will instead be completed the first time that you access a directory. As a result, there may be an increase in the time that is required to access a directory for the first time after mounting an image using the /Optimize argument.

/CheckIntegrity detects and tracks .wim file corruption when used with capture, unmount, export, and commit operations. /CheckIntegrity stops the operation if DISM detects that the .wim file is corrupted when used with apply and mount operations.

Dism /Mount-Image /ImageFile:C:\test\images/myimage.wim /Index:1 /MountDir:C:\test\offline
Dism /Mount-Image /ImageFile:C:\test\images/myimage.vhd /Index:1 /MountDir:C:\test\offline /ReadOnly

/Remount-Image

/MountDir:<path_to_mount_directory>

Remounts a mounted image that has become inaccessible and makes it available for servicing.

Dism /Remount-Image /MountDir:C:\test\offline

/Split-Image

/ImageFile:<path_to_image_file>

/SWMFile:<path_to_swm>

/FileSize:<size_in_MB>

[/CheckIntegrity]

Splits an existing .wim file into multiple read-only split .wim files.

This option creates the .swm files in the specified directory, naming each file the same as the specified <path_to_swm>, but with an appended number. For example, if you set <path_to_swm> as c:\Data.wim, this option creates a Data.swm file, a Data2.swm file, a Data3.swm file, and so on, defining each portion of the split .wim file and saving it to the C:\ directory.

This command-line option does not apply to virtual hard disk (VHD) files.

/FileSize specifies the maximum size in megabytes (MB) for each created file.

JJ980032.note(en-us,WinEmbedded.81).gifNote:
If a single file is larger than the value specified in the /FileSize option, one of the split .swm files that results will be larger than the value specified in the /FileSize option, in order to accommodate the large file

/CheckIntegrity detects and tracks .wim file corruption when used with capture, unmount, export, and commit operations. /CheckIntegrity stops the operation if DISM detects that the .wim file is corrupted when used with apply and mount operations.

Dism /Split-Image /ImageFile:install.wim /SWMFile:split.swm /FileSize:650

/Unmount-Image

/MountDir:<path_to_mount_directory>

{/Commit | /Discard}

[/CheckIntegrity]

[/Append]

Unmounts the .wim, .vhd or .vhdx file and either commits or discards the changes that were made when the image was mounted.

You must use either the /Commit or /Discard argument when you use the /Unmount-Image option.

/CheckIntegrity detects and tracks .wim file corruption when used with capture, unmount, export, and commit operations. /CheckIntegrity stops the operation if DISM detects that the .wim file is corrupted when used with apply and mount operations.

/Append adds the modified image to the existing .wim file instead of overwriting the original image.

The /CheckIntegrity and /Append arguments do not apply to virtual hard disk (VHD) files.

Dism /Unmount-Image /MountDir:C:\test\offline /Commit
Dism /Unmount-Image /MountDir:C:\test\offline /Discard

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

The base syntax for DISM is as follows:

DISM {**/Image:**path_to_offline_image_directory | /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 a running operating system:

Dism.exe /Online [/LogPath:path_to_log_file] [/LogLevel:n] [/Quiet] [/NoRestart] [**/ScratchDir:**path_to_scratch_directory]

Option

Description

/Get-Help [ {/Image:path_to_offline_image_directory | /Online | /command-line_option} ]

/? {/Image:path_to_offline_image_directory | /Online | /command-line_option} ]

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

The options available for servicing an image depend on the servicing technology available in your image. Specifying an image, either offline or online, will generate information about the specific options that are available for that image.

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

/Log-Path: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.

JJ980032.note(en-us,WinEmbedded.81).gifNote:
In Windows PE 4.0, the default directory is the RAMDISK scratch space, which can be as low as 23 MB.
The log file is automatically archived. The archived log file is saved with .bak appended to the file name, and a new log file is generated. Each time the log file is archived, the .bak file will be 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.

/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 informational output

4 = All of the previously mentioned values, plus debug output

/Image:path_to_offline_image_directory

This is the full path to the root directory of the offline Standard 8 image that you will service. If the directory named Windows is not a subdirectory of the root directory, /WinDir must be specified.

This option cannot be used with /Online.

/WinDir:path_to_%WINDIR%

Used with the /Image option to specify the path to the Standard 8 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.

This option cannot be used with the /Online option.

/Online

Specifies that the action is to be taken on the operating system that is currently running.

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

/SysDriverDir:path_to_sysdrive_directory

Specifies the path to the location of 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.

/Quiet

Turns off informational and progress output to the console. Only error messages will be displayed.

To run in quiet mode, this option must be set every time that the command-line utility is run. It must be present before the servicing command.

JJ980032.note(en-us,WinEmbedded.81).gifNote:
Do not use the /Quiet option with the /Get commands. No information will be displayed.

/NoRestart

Suppresses restarting. If a restart is not necessary, then this command does nothing. This option will keep the application from prompting for a restart (or keep it from restarting automatically if the /Quiet option is used).

/ScratchDir:path_to_scratch_directory

Specifies a temporary directory to be used 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 created from a randomly generated hexadecimal value for each run of DISM. Items in the scratch directory are deleted after each operation.

You should not use a network share location as a scratch directory to expand a CBS package (.cab or .msu file) for installation. The directory used for extracting files for temporary use during servicing should be a local directory.

/English

Displays the command-line output in English.

JJ980032.note(en-us,WinEmbedded.81).gifNote:
Some resources cannot be displayed in English.
This option is not supported when using the DISM /? command.

Servicing Command-Line Options

Depending on the image you have specified and whether the image is offline or on a running operating system, servicing commands and arguments might be available for the following types of updates:

See Also

Concepts

What Is Deployment Image Servicing and Management?
How Deployment Image Servicing and Management (DISM) Works

Other Resources

Deployment Image Servicing and Management (DISM) Technical Reference