How to Apply Images by Using DISM
Published: February 29, 2012
Updated: May 31, 2012
Applies To: Windows 8, Windows Server 2008 R2, Windows Server 2012
This topic describes how to deploy images captured from your reference computer to one or more destination computers using the Deployment Image Servicing and Management (DISM) tool.
On the destination computer, you will create a structure for the partitions where you apply your images. The partition structure on the destination computer must match the partition structure of the reference computer.
If you apply an image to a volume with an existing Windows installation, files from the previous installation may not be deleted. Format the volume by using a tool such as DiskPart before applying the new image.
Boot the destination computer to Windows PE. For more information, see Windows Preinstallation Environment (Windows PE) Technical Reference.
Connect to the network distribution share where your Windows image is stored. For example, you can use the net use command to do this:
net use n: \\server\share
If prompted, provide your network credentials.
At the Windows PE command prompt, type
diskpartto start the Diskpart tool.
Create your partition structure using the Diskpart tool. For example:
select disk 0 clean create partition primary size=3000 id=27 format quick fs=ntfs label="Recovery" assign letter="R" create partition primary size=300 format quick fs=ntfs label="System" assign letter="S" active create partition primary format quick fs=ntfs label="Windows" assign letter="W" exit
For examples of recommended partition structures, see How to Configure BIOS/MBR-Based Hard Drive Partitions and How to Configure UEFI/GPT-Based Hard Drive Partitions.
Note You can automate this task with the
diskpart /s <script>command. For more information, see Diskpart Command line syntax.
Use the DISM tool to apply images to your Windows partition.
For each partition that you apply an image to, run the DISM/Apply-Image /ImageFile:<image_file> /index<index_number> /ApplyDir:<image_path> command.
Dism /apply-image /imagefile:N:\Images\my-windows-partition.wim /index:1 /ApplyDir:W:\
For more information about DISM, see Image Management Command-Line Options.
To set up a basic system partition, you can use the BCDboot tool to copy a simple set of system files to a system partition. These files include boot configuration data (BCD) information that is used to start Windows:
Use the BCDboot tool to copy common system partition files and to initialize boot configuration data:
C:\Windows\System32\bcdboot W:\Windows /l en-US
For more information about the BCDboot tool, see BCDboot Command-Line Options.
Note You can also set up the system partition by applying an image. Use the DISM/Apply-Image command. For example:
Dism /apply-image /imagefile:N:\Images\my-system-partition.wim /index:1 /ApplyDir:S:\
You can set up the computer to reinstall your Windows image in the event of a system failure. For more information, see Windows Recovery Environment (Windows RE) Technical Reference.
|Microsoft Reserved partitions (MSR) and Extended partitions are managed by the computer. Do not apply an image to these partitions.|
You can use audit mode to test the computer and to perform additional customizations before you ship it to your end user. For more information, see How to Boot to Audit Mode or OOBE.
You can also perform some customizations to the computer without booting it. For more information, see Walkthrough: Service an Applied Windows Image.
If you receive the error message: Bootmgr not found. Press CTRL+ALT+DEL, this indicates that Windows cannot identify the boot information in the active partition. If you receive this error message, check the following: