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/COMMAND | DESCRIPTION |
GENERAl COMMANDS | |
/Cleanup-Wim | Deletes resources associated with mounted Windows images that are corrupt. |
/Commit-Wim | Saves changes to a mounted Windows image. |
/Get-MountedWimInfo | Displays information about mounted Windows images. |
/Get-WimInfo | Displays information about images in a Windows image file. |
/Image | Specifies the path to the root directory of an offline Windows image. |
/Mount-Wim | Mounts an image from a Windows image file. |
/Online | Targets the running operating system. |
/Remount-Wim | Recovers an orphaned Windows mount directory |
/Unmount-Wim | Unmounts a mounted Windows image. |
ADDITIONAL OPTIONs | |
/English | Displays command-line output in English. |
/Format | Specifies the report output format |
/LogLevel | Specifies the output level shown in the log (1-4). |
/LogPath | Specifies the log file path. |
/NoRestart | Suppresses automatic reboots and reboot prompts. |
/Quiet | Suppresses all output except for error messages. |
/ScratchDir | Specifies the path to a scratch directory. |
/SysDriveDir | Specifies the path to the system loader file named BootMgr. |
/WinDir | Specifies 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
SUBCOMMaNDSD | DESCRIPTION |
/Add-Driver | Adds driver packages to an offline image. |
/Add-Package | Adds packages to the image. |
/Apply-Unattend | Applies an AnswerFile.xml file to an image. |
/Check-AppPatch | Displays information if the MSP patches are applicable to the mounted image. |
/Cleanup-Image | Performs cleanup and recovery operations on the image. |
/Disable-Feature | Disables a specific feature in the image. |
/Enable-Feature | Enables a specific feature in the image. |
/Gen-LangIni | Generates a new Lang.ini file. |
/Get-AppInfo | Displays information about a specific installed MSI application. |
/Get-AppPatches | Displays information about all applied MSP patches for all installed applications. |
/Get-AppPatchInfo | Displays information about installed MSP patches. |
/Get-Apps | Displays information about all installed MSI applications. |
/Get-CurrentEdition | Displays the editions of the specified image. |
/Get-DriverInfo | Displays information about a specific driver in an offline image or a running operating system. |
/Get-Drivers | Displays information about all drivers in an offline image or a running operating system. |
/Get-FeatureInfo | Displays information about a specific feature. |
/Get-Features | Displays information about all features in a package. |
/Get-Intl | Displays information about the international settings and languages. |
/Get-PackageInfo | Displays information about a specific package. |
/Get-Packages | Displays information about all packages in the image. |
/Get-TargetEditions | Displays a list of Windows editions that an image can be upgraded to. |
/Get-TargetEditions | Removes driver packages from an offline image. |
/Remove-Package | Removes packages from the image. |
/Set-AllIntl | Sets all international settings in the mounted offline image. |
/Set-Edition | Sets the input locales and keyboard layouts to use in the mounted offline image. |
/Set-InputLocale | Sets the input locales and keyboard layouts to use in the mounted offline image. |
/Set-LayeredDriver | Sets the keyboard layered driver. |
/Set-ProductKey | Populates the product key into the offline image. |
/Set-SetupUILang | Defines the default language that will be used by Setup. |
/Set-SKUIntlDefaults | Sets all international settings to the default values for the specified SKU language in the mounted offline image. |
/Set-SKUIntlDefaults | Sets the language for non-Unicode programs (also called system locale) and font settings in the mounted offline image. |
/Set-TimeZone | Sets the default time zone in the mounted offline image. |
/Set-UILang | Sets the default system UI language that is used in the mounted offline image. |
/Set-UILangFallback | Sets the fallback default language for the system UI in the mounted offline image. |
/Set-UserLocale | Sets 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.
In this tutorial:
- Deploying Windows 7
- Working with Windows PE
- Understanding Windows pe
- Configuring Windows PE
- Preparing a Build environment
- Creating a Build: the essentials
- Mounting a Windows pe Image
- Customizing a Windows PE Image
- Capturing and Optimizing a Build
- Creating a Bootable ISO Image and Bootable Media
- Creating a Bootable USB Flash Drive
- Booting to an Image from a hard Disk
- Adding Windows pe Images to Windows Deployment Services
- Working with Windows RE
- Creating a Customized Windows RE Image
- Creating Windows re recovery Media
- Adding Windows RE Images to Windows Deployment Services
- Deploying Windows with a Customized Windows RE
- Creating Windows Images for Deployment
- Understanding Windows Imaging
- Creating a Windows Install Image
- Configuring and Using Windows Deployment Services
- Setting Up Windows Deployment Services
- Importing Images
- Installing Windows from an Image
- Capturing Images
- Managing access and prestaging Computers
- Modifying Image File Security
- Customizing Windows Images