QA

Use DISM to Manage Windows Images

Q: How can I use the Deployment Image Servicing and Management tool to enable a role or feature in a mounted Windows Imaging Format or Virtual Hard Disk?

A: Once a Windows Imaging Format (WIM) or Virtual Hard Disk (VHD) has been mounted, you can use the Deployment Image Servicing and Management (DISM) tool to manage it. The following commands can be useful:

  • Create a folder for the mount:
    Mkdir c:\mountwim
  • View images within a WIM file:
    Dism /get-imageinfo /imagefile:"s:\OS Images\Windows Server 2012 R2 Update 1\sources\install.wim"
  • Mount a specific image from a WIM file into the created folder:
    Dism /mount-wim /wimfile:"s:\OS Images\Windows Server 2012 R2 Update 1\sources\install.wim" /index:4 /mountdir:c:\mountwim
  • View all features and their enabled state in the mounted image:
    Dism /image:c:\mountwim /get-features (also could do /get-drivers)
  • View all drivers in the mounted image:
    Dism /image:c:\mountwim /get-drivers
  • Get feature information for a specific role:
    Dism /image:c:\mountwim /get-featureinfo /featurename:file-services
  • Enable a role and all subroles:
    Dism /image:c:\mountwim /enable-feature /featurename:file-services –all
  • Unmount a WIM and save the changes (use /discard to not save changes):
    Dism /unmount-wim /mountdir:c:\mountwim /commit
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish