Active Directory/Documentation/WDS/Management/Images/Mounting WIMs with DISM
Jump to navigation
Jump to search
Mounting
To mount a WIM file using the DISM tool, follow this procedure:
- Open a Deployment Tools Command Prompt (using elevated/Administrator privileges)
- Navigate to the location of the WIM file (e.g., "cd \storage\Images\Boot")
- Create, if needed, a directory to mount the WIM file (e.g., "mkdir \storage\Images\mounted")
- Determine which WIM index to mount:
- Execute "dism /get-wiminfo /wimfile:<wimImageFile>"
- Examine the output to find the index number corresponding to the image you want updated:
- Most custom WIMs will only contain one image, with an index of 1
- Existing WIMs from Microsoft media will generally contain 2 images, one usually being the Windows PE environment, and two being the WDS boot client
- If you are adding network (or other) drivers to the WDS boot images, you almost always want to use the WDS boot client image.
- Note the index number belonging to the image within the WIM that you want to mount
- Execute the following: "dism /mount-wim /wimfile:<wimImageFile> /index:<index#> /mountdir:<mountDirectory>"
A production example is: 'dism /mount-wim /wimfile:"Windows 7 - Stock.wim" /index:2 /mountdir:..\..\wimMount' - note the use of quotation marks around the filename of a WIM file that has spaces in the name.
Unmounting
To unmount a WIM file using the DISM tool, follow this procedure:
- If one is not already open, open a Deployment Tools Command Prompt (using elevated/Administrator privileges)
- Navigate to the location of the WIM file (e.g., "cd \storage\Images\Boot")
- Execute "dism /unmount-wim /mountdir:<mountDirectory> {/commit|/discard}"
- If you want to save the changes you made to the WIM, use the /commit option.
- If you do not want to save the changes you made to the WIM, use the /discard option.
A production example from the same session as the previous example is: "dism /unmount-wim /mountdir:..\..\wimMount /commit"