Deployment Image Servicing and Management Command-Line Options
Applies To: Windows 7
Note
This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.
Deployment Image Servicing and Management (DISM.exe) installs, uninstalls, configures, and updates the features and packages in offline Windows® images and offline Windows Preinstallation Environment (Windows PE) images. The commands and options that are available for servicing an image depend on which Windows operating system you are servicing (Windows® 7, Windows Vista® with Service Pack 2 (SP2), Windows Vista® with Service Pack 1 (SP1), Windows Server® 2008 R2, Windows Server® 2008, or Windows PE), and whether the image is offline or a running operating system. All commands work on an offline Windows 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 Windows image is made available for servicing by mounting the image or specifying a running operating system.
DISM replaces several Windows OEM Preinstallation Kit (Windows OPK) tools including PEImg, Intlcfg, and Package Manager.
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 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.
Example:
|
||
/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:
|
||
/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:
|
||
/Remount-Wim |
/MountDir:<path_to_mount_directory> |
Remounts a mounted WIM file that has become inaccessible and makes it accessible for servicing. Example:
|
||
/Cleanup-Wim |
Deletes all of 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:
|
|||
/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 or /Name option, information about the specified image is displayed. Example:
|
||
/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:
|
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 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 running computer, you can use the /Online option instead of specifying the location of the offline Windows Image.
The base syntax for DISM is:
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 a running operating system.
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 each DISM option can be used. These options are not case sensitive.
Option | Description | ||
---|---|---|---|
/Get-Help /? |
Displays information about available DISM command-line options and arguments. The options that are available for servicing an image depend on the servicing technology that is available in your image. Specifying an image, either an offline image or the running operating system will generate information about specific options that are available for the image you are servicing. Example:
You can display additional Help by specifying a command-line option. Example:
|
||
/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
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:
|
||
/LogLevel:<n> |
Specifies the maximum output level shown in the logs. The default log level is 3. The accepted values are: 1 = Errors only 2 = Errors and warnings 3 = Errors, warnings, and informational 4 = All the above and debug output Example:
|
||
/Image:<path_to_offline_image_directory> |
This is the full path to the root directory of the offline Windows 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. Example:
|
||
/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. This option cannot be used with the /Online option. Example:
|
||
/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 option. When /Online is used the Windows directory for the online image is automatically detected. Example:
|
||
/SysDriveDir:<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. Example:
|
||
/Quiet |
Turns off information 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. Note Do not use the /Quiet option with /Get commands. No information will be displayed.
Example:
|
||
/NoRestart |
Suppresses reboot. If a reboot 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). Example:
|
||
/ScratchDir:<path_to_scratchdirectory> |
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 of 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 package (.cab or .msu file) for installation. The directory used for extracting files for temporary usage during servicing should be a local directory. Example:
|
||
/English |
Displays command-line output in English. Note Some resources cannot be displayed in English.
Example:
|
Servicing Command-Line Options
Depending on the image you have specified (Windows 7, Windows Vista with SP2, Windows Vista with SP1, Windows Server 2008 R2, Windows Server 2008, or Windows PE) and whether the image is offline or a running operating system, servicing commands and arguments might be available for the following types of updates:
Note
You cannot use two different types of servicing commands in the same command line.
Windows PE–specific servicing commands for preparing a Windows PE image. For more information, see Windows PE Servicing Command-Line Options.
Driver-specific servicing commands for adding, removing, and enumerating driver .inf files. For more information, see Driver Servicing Command-Line Options
Package-servicing commands for adding, removing, and enumerating packages and enabling, disabling, and enumerating features. For more information, see Operating System Package Servicing Command-Line Options
International-servicing commands for adjusting international settings and configurations. For more information, see Languages and International Servicing Command-Line Options
Edition-servicing commands for changing the edition of your Windows image. For more information, see Windows Edition-Servicing Command-Line Options
Servicing commands that can be used to apply an Unattend.xml file. For more information, see Unattended Servicing Command-Line Options.
Servicing commands that can be used to check the applicability of Windows® Installer application patches (.msp files) and to query your offline image for information about installed MSI applications and application patches (.msp files). For more information, see Application Servicing Command-Line Options.
See Also
Concepts
Deployment Image Servicing and Management Technical Reference
What Is Deployment Image Servicing and Management?
How Deployment Image Servicing and Management Works