WDS: Add Driver Packages to Image wizard fails
When you attempt to add driver packages to a boot image using the Windows Deployment Service MMC which fails to complete or the process hangs, you’re left with a mounted version of your WIM image buried deep somewhere in your WDS server.
The default mount location of the offending images is %TEMP%, or usually:
Inside this folder will be the mount location folder, often ~$WDSMGMT.00[n] where [n] is a number.
In order to discard the mounted WIM, use the following command:
dism /unmount-wim /mountdir:C:\Users\[username]\AppData\Local\Temp\1\~$WDSMGMT.000 /discard
Upon doing so, ensure you have closed all Explorer windows or you may receive the following error.
The directory could not be completely unmounted. This is usually due
to applications that still have files opened within the mount directory.
Close these files and unmount again to complete the unmount process.
If you have closed all open Explorer windows and you are still receiving the error, open Regedit and navigate to
HKEY_LOCAL_MACHINE\Software\Microsoft\WIMMount\Mounted Images and delete any subkeys there.
If all else fails, a reboot of your WDS box may be necessary to terminate any processes that might still be hanging on to the folder. Once you have rebooted, re-check and delete any sub-keys in the registry before again attempting to unmount and discard the image.