DISM command

Updated: 11/12/2023 by Computer Hope
Windows DISM command

Short for Deployment Image Servicing and Management, DISM is a command available in Microsoft Windows used to install and configure Windows binary images.

Availability

The DISM command is available in the following Microsoft operating systems:

Description

DISM lists, installs, uninstalls, configures, and updates features and packages in Windows images. The commands available depend on the image being serviced, and whether the image is currently loaded and running.

DISM command syntax

The following is the command syntax for the Deployment Image Servicing and Management tool (DISM version 10.0.22000.653):

DISM.exe [dism_options] Imaging_command [Imaging_arguments]
DISM.exe {/Image:path_to_offline_image | /Online} [dism_options]
         servicing_command [servicing_arguments]

FFU commands

/Capture-Ffu Captures a physical disk image to a new FFU file.
/Apply-Ffu Applies an .ffu image.
/Split-Ffu Splits an existing .ffu file into multiple read-only split FFU files.
/Optimize-Ffu Optimizes an FFU file so that it can be applied to storage of a different size.

WIM commands

/Apply-CustomDataImage Dehydrates files contained in the custom data image.
/Capture-CustomImage Captures customizations into a delta WIM file on a WIMBoot system. Captured directories include all subfolders and data.
/Get-WIMBootEntry Displays WIMBoot configuration entries for the specified disk volume.
/Update-WIMBootEntry Updates WIMBoot configuration entry for the specified disk volume.
/List-Image Displays a list of the files and folders in a specified image.
/Delete-Image Deletes the specified volume image from a WIM file with multiple volume images.
/Export-Image Exports a copy of the specified image to another file.
/Append-Image Adds another image to a WIM file.
/Capture-Image Captures an image of a drive into a new WIM file. Captured directories include all subfolders and data.
/Get-MountedWimInfo Displays information about mounted WIM images.
/Get-WimInfo Displays information about images in a WIM file.
/Commit-Wim Saves changes to a mounted WIM image.
/Unmount-Wim Unmounts a mounted WIM image.
/Mount-Wim Mounts an image from a WIM file.
/Remount-Wim Recovers an orphaned WIM mount directory.
/Cleanup-Wim Deletes resources associated with mounted WIM images that are corrupted.

Generic imaging commands

/Split-Image Splits an existing .wim file into multiple read-only SWM (split WIM) files.
/Apply-Image Applies an image.
/Get-MountedImageInfo Displays information about mounted WIM and VHD images.
/Get-ImageInfo Displays information about images in a WIM, a VHD or an FFU file.
/Commit-Image Saves changes to a mounted WIM or VHD image.
/Unmount-Image Unmounts a mounted WIM or VHD image.
/Mount-Image Mounts an image from a WIM or VHD file.
/Remount-Image Recovers an orphaned image mount directory.
/Cleanup-Mountpoints Deletes resources associated with corrupted mounted images.

Image specifications

/Online Targets the running operating system.
/Image Specifies the path to the root directory of an offline Windows image.

DISM options

/English Displays command line output in English.
/Format Specifies the report output format.
/WinDir Specifies the path to the Windows directory.
/SysDriveDir Specifies the path to the system-loader file named bootmgr.
/LogPath Specifies the logfile path.
/LogLevel Specifies the output level shown in the log (1-4).
/NoRestart Suppresses automatic reboots and reboot prompts.
/Quiet Suppresses all output except for error messages.
/ScratchDir Specifies the path to a scratch directory.

For more information about these DISM options and their arguments, specify an option immediately before /?.

For example, to get help about the following commands, append "/?":

DISM.exe /Mount-Wim /?
DISM.exe /ScratchDir /?
DISM.exe /Image:C:\test\offline /?
DISM.exe /Online /?

DISM examples

Note

The DISM command requires an elevated command prompt to run.

dism /online /cleanup-image /checkhealth

The command above runs the DISM command to check for any corruption.

dism /online /cleanup-image /restorehealth

The command above restores any found corruption.

dism /online /cleanup-image /analyzecomponentstore

The command above reports the Windows Update component store and report its usage as shown below. If the command reclaims packages, you are asked to restart the computer.

Deployment Image Servicing and Management tool
Version: 10.0.19041.844
Image Version: 10.0.19044.2486
[==========================100.0%==========================]
Component Store (WinSxS) information:
Windows Explorer Reported Size of Component Store : 8.18 GB
Actual Size of Component Store : 7.98 GB
    Shared with Windows : 5.64 GB
    Backups and Disabled Features : 2.33 GB
    Cache and Temporary Data :  0 bytes
Date of Last Cleanup : 2023-01-15 17:12:13
Number of Reclaimable Packages : 0
Component Store Cleanup Recommended : No
The operation completed successfully.
Tip

If corruption is found when running the DISM command, it's also a good idea to run SFC /scannow to repair the Windows install.