Windows 7 / Getting Started

Customizing Windows Images

You can customize a mounted boot or install image using the DISM utility. Available options for DISM are summarized in Table below. All components in an image are managed via the component store.

Key Options for the DISM Utility

COMMAND TYPE/COMMANDDESCRIPTION
GENERAl COMMANDS
/Cleanup-WimDeletes resources associated with mounted Windows images that are corrupt.
/Commit-WimSaves changes to a mounted Windows image.
/Get-MountedWimInfoDisplays information about mounted Windows images.
/Get-WimInfoDisplays information about images in a Windows image file.
/ImageSpecifies the path to the root directory of an offline Windows image.
/Mount-WimMounts an image from a Windows image file.
/OnlineTargets the running operating system.
/Remount-WimRecovers an orphaned Windows mount directory
/Unmount-WimUnmounts a mounted Windows image.
ADDITIONAL OPTIONs
/EnglishDisplays command-line output in English.
/FormatSpecifies the report output format
/LogLevelSpecifies the output level shown in the log (1-4).
/LogPathSpecifies the log file path.
/NoRestartSuppresses automatic reboots and reboot prompts.
/QuietSuppresses all output except for error messages.
/ScratchDirSpecifies the path to a scratch directory.
/SysDriveDirSpecifies the path to the system loader file named BootMgr.
/WinDirSpecifies the path to the Windows directory.

Once you mount an image, you are able to work with the mounted image using the Dism /Image subcommands listed in Table below. These subcommands allow you to upgrade the image to a higher edition, add and remove device drivers, specify time zones and language UI options, display patches and installed MSI applications, add and remove packages, and more.

Important Subcommands for Mounted and Offline Images

SUBCOMMaNDSDDESCRIPTION
/Add-DriverAdds driver packages to an offline image.
/Add-PackageAdds packages to the image.
/Apply-UnattendApplies an AnswerFile.xml file to an image.
/Check-AppPatchDisplays information if the MSP patches are applicable to the mounted image.
/Cleanup-ImagePerforms cleanup and recovery operations on the image.
/Disable-FeatureDisables a specific feature in the image.
/Enable-FeatureEnables a specific feature in the image.
/Gen-LangIniGenerates a new Lang.ini file.
/Get-AppInfoDisplays information about a specific installed MSI application.
/Get-AppPatchesDisplays information about all applied MSP patches for all installed applications.
/Get-AppPatchInfoDisplays information about installed MSP patches.
/Get-AppsDisplays information about all installed MSI applications.
/Get-CurrentEditionDisplays the editions of the specified image.
/Get-DriverInfoDisplays information about a specific driver in an offline image or a running operating system.
/Get-DriversDisplays information about all drivers in an offline image or a running operating system.
/Get-FeatureInfoDisplays information about a specific feature.
/Get-FeaturesDisplays information about all features in a package.
/Get-IntlDisplays information about the international settings and languages.
/Get-PackageInfoDisplays information about a specific package.
/Get-PackagesDisplays information about all packages in the image.
/Get-TargetEditionsDisplays a list of Windows editions that an image can be upgraded to.
/Get-TargetEditionsRemoves driver packages from an offline image.
/Remove-PackageRemoves packages from the image.
/Set-AllIntlSets all international settings in the mounted offline image.
/Set-EditionSets the input locales and keyboard layouts to use in the mounted offline image.
/Set-InputLocaleSets the input locales and keyboard layouts to use in the mounted offline image.
/Set-LayeredDriverSets the keyboard layered driver.
/Set-ProductKeyPopulates the product key into the offline image.
/Set-SetupUILangDefines the default language that will be used by Setup.
/Set-SKUIntlDefaultsSets all international settings to the default values for the specified SKU language in the mounted offline image.
/Set-SKUIntlDefaultsSets the language for non-Unicode programs (also called system locale) and font settings in the mounted offline image.
/Set-TimeZoneSets the default time zone in the mounted offline image.
/Set-UILangSets the default system UI language that is used in the mounted offline image.
/Set-UILangFallbackSets the fallback default language for the system UI in the mounted offline image.
/Set-UserLocaleSets the user locale in the mounted offline image.

The Deployment Image Servicing and Management tool provides commands for working with WIM images. The syntax for mounting images is:

dism /mount-wim /wimfile:Path /index:Index /mountdir:MountPath

where Path is the full path to the WIM image, Index is the index position of the image number of the image within the .wim file to apply, and MountPath is the directory location where you'd like to mount the image, such as:

dism /mount-wim /wimfile:c:\winpe_x86\iso\sources\boot.wim /index:1
/mountdir:c:\win7

You can then modify the image as necessary. To commit your changes at any time, you can use Dism /Commit-Wim as shown in the following example:

dism /commit-wim /mountdir:c:\win7

Here, you commit changes to the WIM images mounted in the C:\Win7 directory. To unmount a WIM file, you can use Dism /Unmount-Wim as shown in the following example:

dism /unmount-wim /mountdir:c:\win7

Here, you unmount the WIM image that was mounted and committed in the C:\Win7 directory. If there are uncommitted changes you must commit or discard changes when you unmount a WIM image. Add /Commit to commit changes or /Discard to discard changes. This affects only the changes you haven't previously committed.

[Previous] [Contents]