Applies To: Windows 8, Windows Server 2008 R2, Windows Server 2012
This document describes the Deployment Image Servicing and Management (DISM) command-line tool to modify Windows® images or to enable/disable Windows features directly from the command prompt.
To mount an offline image for servicing
Determine the index number for the image that you want to modify |
Dism /Get-ImageInfo /ImageFile:C:testimagesinstall.wim
Dism /get-wiminfo /wimfile:c:datainstall_2012.wim |
Mount the offline Windows image.
Mount the WIM file using this command at an elevated command prompt |
Dism /Mount-Image /ImageFile:C:testimagesinstall.wim /Name:”Base Windows Image” /MountDir:C:testoffline
Dism /mount-wim /WimFile:c:datainstall_2012.wim /Index:2 /MountDir:c:datamount /readonly |
To find available Windows features in an image |
Dism /Image:C:testoffline /Get-Features Dism /online /Get-Features |
to list information about the specific feature you are interested in. (DISM will contact Windows Update). |
Dism /online /Get-FeatureInfo /FeatureName:Hearts |
To enable Windows features |
Dism /online /Enable-Feature /FeatureName:Hearts /All
Dism /Image:C:testoffline /Enable-Feature /FeatureName:Hearts /All |
To disable Windows features |
Dism /online /Disable-Feature /FeatureName:Hearts
Dism /Image:C:testoffline /Disable-Feature /FeatureName:Hearts |
To remove Windows features for on-demand installation |
Dism /online /Disable-Feature /FeatureName:Hearts /Remove
Dism /Image:C:testoffline /Disable-Feature /FeatureName:Hearts /Remove |
To commit changes on an offline image |
Dism /Unmount-Image /MountDir:C:testoffline /Commit |