An Engineers Notebook

Using DISM to Add Drivers / Packages / Install Roles and Features in a .wim file

The following reference folders that contain the relevent drivers/packages. Ensure you have the driver/package in the right location e.g. .drivers

### DISM - Deployment Image Servicing and Management Command-line Utility ###
## Desktop Experience & Server Core ##
# display help
dism /?
# view images within a .wim
dism /get-imageinfo /imagefile:.imagesinstall.wim
# mount server core datacenter image
dism /mount-image /imagefile:.imagesinstall.wim /index:3 /mountdir:.mount
# add drivers (.inf)
dism /image:.mount /get-drivers
dism /image:.mount /add-driver /driver:.drivers
dism /image:.mount /remove-driver /driver:.driversiaStorAC.inf
# add patches, hotfixes, and updates (.msu or .cab)
dism /image:.mount /get-packages
dism /image:.mount /add-package /packagepath:.updates
dism /image:.mount /remove-package /packagepath:.updateswindows10.0-kb3150513.msu
# install roles and features
dism /image:.mount /get-features
dism /image:.mount /get-featureinfo /featurename:web-server
dism /image:.mount /enable-feature /featurename:web-server /all
dism /image:.mount /disable-feature /featurename:web-server
# dismount and commit all changes
dism /unmount-image /mountdir:.mount /commit

## Nano Server ##
# view nano server images
dism /get-imageinfo /imagefile:.imagesnanoserver.wim
# mount nano server datacenter image
dism /mount-image /imagefile:.imagesnanoserver.wim /index:2 /mountdir:.mount
# add nano server package
dism /image:.mount /add-package /package:d:nanoserverpackagesmicrosoft-nanoserver-containers-package.cab
# dismount and commit all changes
dism /unmount-image /mountdir:.mount /discard

 

Leave a Reply

Your email address will not be published.