Show Menu
Cheatography

DISM - Deployment Image Servicing and Management Cheat Sheet (DRAFT) by

command line reference

This is a draft cheat sheet. It is a work in progress and is not finished yet.

dism /Mount­-Image

Dism /Mount­-Image /Image­Fil­e:C­:\t­est­\im­age­s\m­yim­age.wim /index:1 /Mount­Dir­:C:­\te­st­\offline
/ImageFile
<pa­th_­to_­ima­ge_­fil­e>
/Index:
<im­age­_in­dex>
/Name:
<im­age­_na­me>
[/Chec­kIn­teg­rity]
detects and tracks .wim file corruption when used with capture, unmount, export, and commit operat­ions.
/MountDir:
<pa­th_­to_­mou­nt_­dir­ect­ory>
[/Read­Only]
sets the mounted image with read-only permis­sions. Optional.
[/Opti­mize]
reduce initial mount time
Mounts an image from a .wim, .vhd or .vhdx file to the specified directory so that it is available for servicing.

dism /Commi­t-Image

Dism /Commi­t-Image /Mount­Dir­:C:­\te­st­\offline
/MountDir:
<pa­th_­to_­mou­nt_­dir­ect­ory>
[/Chec­kIn­teg­rity]
detects and tracks .wim file corruption when used with capture, unmount, export, and commit operations
[/Append]
adds the modified image to the existing .wim file instead of overwr­iting the original image
Applies the changes that you have made to the mounted image. The image remains mounted until the /Unmou­nt-­Image option is used.

Dism /Clean­up-­Mou­ntp­oints

Dism /Clean­up-­Mou­ntp­oints
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 /Remou­nt-­Image command.

dism /Delet­e-Image

Dism /Delet­e-Image /Image­Fil­e:i­nst­all.wim /Index:1
/ImageFile
<pa­th_­to_­ima­ge_­fil­e>
/Index:
<im­age­_in­dex>
/Name:
<im­age­_na­me>
[/Chec­kIn­teg­rity]
detects and tracks .wim file corruption when used with capture, unmount, export, and commit operat­ions.
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.

/Captu­re-­Image

Dism /Captu­re-­Image /Image­Fil­e:i­nst­all.wim /Captu­reD­ir:D:\ /Name:­Drive-D
/ImageFile
<pa­th_­to_­ima­ge_­fil­e>
/Captu­reDir
<so­urc­e_d­ire­cto­ry>
/Name:
<im­age­_na­me>
/Descr­iption:
<im­age­_de­scr­ipt­ion>
/Confi­gFi­le:­<co­nfi­gur­ati­on_­fil­e.i­ni>
specifies the location of a config­uration file that lists exclusions for image capture and compress commands
/Compress:
specifies the type of compre­ssion used for the initial capture operation. The maximum option provides the best compre­ssion, but takes more time to capture the image. The fast option provides faster image compre­ssion, but the resulting files are larger than those compressed by using the maximum option. This is also the default compre­ssion type that is used if you do not specify the argument. The none option does not compress the captured image at all.
[/Boot­able]
marks a volume image as being a bootable image. This argument is available only for Windows PE images.
[/Chec­kIn­teg­rity]
detects and tracks .wim file corruption when used with capture, unmount, export, and commit operat­ions.
[/Verify]
checks for errors and file duplic­ation
[/NoRpFix]
disables the reparse point tag fix. A reparse point is a file that contains a link to another file on the file system
[/WIMBoot]
to capture the image with Windows image file boot (WIMBoot) config­ura­tion. This only applies to Windows 8.1 Update images that you want to capture as a WIMBoot file.
Captures an image of a drive to a new .wim file. Captured direct­ories include all subfolders and data. You cannot capture an empty directory. A directory must contain at least one file.
You can capture the image as a Windows image (.WIM) file or a set of split Windows image (.SWM) files; this option doesn’t support capturing a virtual hard disk (VHD) file.

Dism /Expor­t-Image

Dism /Expor­t-Image /Sourc­eIm­age­Fil­e:i­nst­all.wim /Sourc­eIn­dex:1 /Desti­nat­ion­Ima­geF­ile­:in­sta­ll2.wim
{/Sour­ceI­mag­eFile:
<pa­th_­to_­ima­ge_­fil­e>
/SWMFi­le:­<pa­tte­rn>
enables you to reference split .wim files. pattern is the naming pattern and location of split files. You can also specify wildcard charac­ters. For example, "­E:­\ima­ge­\ins­tal­l*.s­wm­" will export the split files in the E:\image directory named instal­l1.swm, instal­l2.swm, and so on.
Exports a copy of the specified image to another file. The source and destin­ation files must use the same compre­ssion 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 unnece­ssary resource files.

Dism /Get-M­oun­ted­Ima­geInfo

Dism /Get-M­oun­ted­Ima­geInfo
Lists the images that are currently mounted and inform­ation about the mounted image such as whether the image is valid, read/write permis­sions, mount location, mounted file path, and mounted image index.

/Get-I­mag­eInfo

Dism /Get-I­mag­eInfo /Image­Fil­e:C­:\t­est­\of­fli­ne­\ins­tal­l.wim
/Image­File:
<pa­th_­to_­ima­ge.w­im>
/Index:
<Im­age­_in­dex>
/Name:
<Im­age­_na­me>
Displays inform­ation about the images that are contained in the .wim, vhd or .vhdx file. When used with the /Index or /Name argument, inform­ation about the specified image is displayed, which includes if an image is a WIMBoot image, if the image is Windows 8.1 Update, see Take Inventory of an Image or Component Using DISM. The /Name argument does not apply to VHD files. You must specify /Index:1 for VHD files.
 

Dism /Unmou­nt-­Image

Dism /Unmou­nt-­Image /Mount­Dir­:C:­\te­st­\offline /commit
/MountDir:
<pa­th_­to_­mou­nt_­dir­ect­ory>
/Commit
You must use either the /commit or /discard argument when you use the /Unmou­nt-­Image option.
/Discard
You must use either the /commit or /discard argument when you use the /Unmou­nt-­Image option.
/Append
adds the modified image to the existing .wim file instead of overwr­iting the original image.
/Check­Int­egrity
detects and tracks .wim file corruption when used with capture, unmount, export, and commit operations
Unmounts the .wim, .vhd or .vhdx file and either commits or discards the changes that were made when the image was mounted.

Dism.exe /Appen­d-Image

Dism /Appen­d-Image /Image­Fil­e:i­nst­all.wim /Captu­reD­ir:D:\ /Name:­Drive-D
/Confi­gFi­le:­<co­nfi­gur­tio­n_f­ile.in­i>]
specifies the location of a config­uration 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
/WIMBoot
Use to append the image with Windows image file boot (WIMBoot) config­ura­tion. This only applies to Windows 8.1 Update images that have been captured or exported as a WIMBoot file
/NoRpFix
disables the reparse point tag fix. A reparse point is a file that contains a link to another file on the file system.
/Image­File:
<pa­th_­to_­ima­ge_­fil­e> path to .wim file to append
/Captu­reDir:
<so­urc­e_d­ire­cto­ry>
/Name:
<im­age­_na­me>
/Descr­iption:
<im­age­_de­scr­ipt­ion>
Adds an additional image to a .wim file. /Appen­dImage 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 compre­ssion type. Therefore, you can only append files with the same compre­ssion type.

Dism.exe /Apply­-Image

Dism /apply­-image /image­fil­e:i­nst­all.wim /index:1 /Apply­Dir:D:\
/Image­File:
<pa­th_­to_­ima­ge_­fil­e>
/ApplyDir:
<ta­rge­t_d­ire­cto­ry>
/Index:
< image_­ind­ex>
/Name:
<im­age­_na­me>
[/Chec­kIn­teg­rity]
detects and tracks .wim file corruption when used with capture, unmount, export, and commit operat­ions.
[/Verify]
checks for errors and file duplic­ation.
[/NoRpFix]
disables the reparse point tag fix. A reparse point is a file that contains a link to another file on the file system
[/Conf­irm­Tru­ste­dFile]
validates the image for Trusted Desktop on a Windows 8 or Windows 8.1.
[/WIMBoot]
apply the image with Windows image file boot (WIMBoot) config­uration
Applies an image to a specified drive.

dism.exe /Captu­re-­Cus­tom­Image

Dism /Captu­re-­Cus­tom­Image /Captu­reD­ir:D:\
/Captu­reDir:
specifies the directory to which the image was applied and custom­ized.
[/Chec­kIn­teg­rity]
detects and tracks .wim file corruption when used with capture, unmount, export, and commit operat­ions.
/Confi­rmT­rus­tedFile
validates the image for Trusted Desktop on a Windows 8 or Windows 8.1
[/Verify]
checks for errors and file duplic­ation.
Captures the increm­ental file changes based on the specific instal­l.wim file to a new file, custom.wim for a WIMBoot image. You can’t capture an empty directory. The captured files are converted to pointer files. The custom.wim is placed in the same folder next to the instal­l.wim. You can only capture the custom image once. Don’t remove or recapture a custom.wim after capturing the increm­ental file changes.

Dism /Remou­nt-­Image

Dism /Remou­nt-­Image /Mount­Dir­:C:­\te­st­\offline
/MountDir:
<pa­th_­to_­mou­nt_­dir­ect­ory>
Remounts a mounted image that has become inacce­ssible and makes it available for servicing.

Dism /Split­-Image

Dism /Split­-Image /Image­Fil­e:i­nst­all.wim /SWMFi­le:­spl­it.swm /FileS­ize:650
/Image­File:
<pa­th_­to_­ima­ge_­fil­e>
/SWMFile:
<pa­th_­to_­swm>
/FileSize:
specifies the maximum size in megabytes (MB) for each created file.
[/Chec­kIn­teg­rity]
detects and tracks .wim file corruption when used with capture, unmount, export, and commit operat­ions.
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_t­o_swm, but with an appended number. For example, if you set path_t­o_swm as c:\Dat­a.swm, 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.

Capture Images of Paritions w/ DISM

Determine Partition to capture 
Use diskpart to assign drive letter 
Dism /Capture-Image /ImageFile:c:\my-windows-partition.wim /CaptureDir:C:\ /Name:"My Windows partition"
net use n: \\Server\Share
md N:\Images\
copy C:\my-windows-partition.wim N:\Images\