The last post showed you how to capture a customized Windows installation to a WIM file using the ImageX tool that is part of the Windows ADK. Today we will use the Deployment Image Servicing and Management (DISM) tool, which is natively part of Windows, to accomplish the same thing.
The process to capture an image using DISM is nearly identical to what is followed for ImageX. For this reason, the first step of this tutorial will be to follow the directions from the last post up to the point where the VHD is mounted to the virtual machine with Windows ADK installed. Note that to use DISM, the Windows ADK does not have to be installed as it does for ImageX — it can be a clean Windows install.
After the image is mounted and is assigned a drive letter in File Explorer, open an elevated command prompt and enter the following command, assuming H: is the drive to be captured and E:\ is where you want the image file saved.
Unlike ImageX, DISM does not immediately show a percentage of the progress. It will after a few moments but until then it will appear that the program is not doing anything. To verify that the computer is doing something and not locked up, open Task Manager (Ctrl + Shift + Esc). This will show that DISM is in fact processing disk activity, memory, and CPU cycles.
Interestingly, the image created using DISM is 8.9% bigger than the image created with ImageX even though they are images of the exact same disk.