Friday, November 27, 2015

windows server 2012 r2 - DISM /add-package syntax

I'm having difficulty with the syntax for dism /add-package on Windows Server, and what it requires as arguments in some cases. I can't find good (unambiguous) reference material for this online, I've tried.


The situation is that I'm trying to service the /online system; I managed to /remove-package an entire package so I tried to re-add it using /add-package, which should be simple, from install.wim on the DVD. But the needed arguments are not clearly explained on Microsoft's websites, for /add-package to a live system, and surprisingly I couldn't get it right. I also tried to mounted the install.wim as a folder and to /add-package from that, but again, could not find the syntax to make it work. Help would really be appreciated.



  1. DISM /get-feature needs a .WIM or a folder as a source where the feature can be found. What would count as a valid location, and especially, must a .WIM be mounted or is pointing to the install.wim (or install.wim:index) enough? If a .WIM + index can be directly referenced, what is the syntax?


  2. When adding a package using /add-package, is the package path/file itself a sufficient identifier, or must one provide a package name or other identifier as well? If so, what identifiers are valid and how are they found?


  3. If the package files are within a wim (eg the install DVD's install.wim) does one need to specify a path within that .WIM, or is specifying the .WIM (or .WIM+index) alone, enough?


  4. dism /image:X:\MOUNTEDWIM /get-packages on a mounted windows install.wim, only shows the few packages that seem to be relevant to the install; many packages that I expected to be in the source weren't listed. But trying to be more specific, using dism /image:X:\MOUNTEDWIM\Windows\servicing\Packages /get-packages, fails completely. What's wrong?


  5. What is the syntax to add an entire removed package to the live /online system, from say, install.wim:2 (from DVD or mounted folder, or either), if the package was accidentally /removed? What identifier or path, and other arguments, would I use?



Failed syntax I tried (using source DVD -> install.wim file):



  • dism /online /add-package /packagepath:"Microsoft-Windows-PACKAGE~amd64~~6.3.9600.16384" /limitaccess /source:"X:\sources\install.wim"

  • dism /online /add-package /packagename:NAME /packagepath:"X:\sources\install.wim\"

  • dism /online /enable-feature /featurename:NAME /All /Source:"X:\sources\install.wim" /LimitAccess

  • dism /online /get-features /Source:"X:\sources\install.wim" /LimitAccess

  • dism /online /add-package /packagepath:"Microsoft-Windows-PACKAGE~amd64~~6.3.9600.16384" /source:install.wim

  • dism /online /add-package /packagepath:install.wim

  • dism /online /add-package /packagepath:install.wim /ignorecheck


Failed syntax (same install.wim file, mounted as a folder):



  • dism /online /add-package /packagename:NAME /all /packagepath:X:\MOUNTEDWIM\Windows

  • dism /online /add-package /packagename:NAME /packagepath:X:\MOUNTEDWIM\Windows

  • dism /get-packages /image:X:\MOUNTEDWIM\Windows

  • dism /get-packages /packagepath:X:\MOUNTEDWIM\Windows

  • dism /image:X:\MOUNTEDWIM /get-packages


(Not one was correct!)

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...