The process of setting up a new PC can be simplified using the DISM tool, which allows you to create a comprehensive Windows installer with all necessary applications pre-loaded.
Setup Requirements
Before starting, ensure the Windows install is generalized using Sysprep, which removes user-specific information and disables Microsoft Store updates temporarily. This should be done on a fresh Windows installation. Additionally, prepare two external drives – one for storing the captured image, and a bootable USB with Windows Preinstallation Environment (Windows PE).
Creating a Bootable Windows PE Drive
First, download and install the Windows Assessment and Deployment Kit (ADK) along with the Windows PE add-on. Follow Microsoft's instructions to create a bootable Windows PE drive. A common challenge might be an error regarding GPT partitions when using DiskPart, which can be resolved by converting the drive to MBR before flashing Windows PE.
Generalizing Your Windows Image
Access Audit Mode by using the shortcut Ctrl+Shift+F3 immediately upon boot. Avoid internet connection to prevent automatic updates. Disable Microsoft Store updates and pause Windows Update. Install desired software without using the Microsoft Store and place any downloaded files in a folder directly on the C:\ root. Execute the Sysprep tool (%WINDIR%\system32\sysprep\sysprep.exe) with the options to enter OOBE mode, generalize the image, and shut down the system after completion.
Capturing the Windows Image
Boot your prepared PC using the Windows PE USB. Connect both the Windows partition and the image drive. Open Command Prompt and utilize diskpart to list and assign drive letters: select volume X and assign letter <letter>. To capture the image, use the command:
Dism /Capture-Image /ImageFile:"D:\Images\WindowsImage.wim" /CaptureDir:C:\ /Name:WindowsImage
Upon completion, the PC will shut down.
Applying the Captured Image
Store a partition-creation script (CreatePartitions.txt) and an ApplyImage.bat file on the image drive. On the target PC, boot from the Windows PE drive, assign a drive letter to the image drive using diskpart, then execute:
- diskpart /s D:\CreatePartitions.txt
- D:\ApplyImage.bat D:\Images\WindowsImage.wim
When complete, remove the USBs and boot into Windows, with your image and applications ready to go.
Utilizing DISM commands on Windows 10 via this methodology allows easy reproduction of a specific setup across multiple PCs, making it an ideal solution for managing large deployments while maintaining system integrity efficiently.