I recently needed to re-capture a Windows 8.1 Reference Image to include the latest security patches and noticed the size of the reference WIM was beginning to creep up. This reminded me of a DISM command which I had read about but never actually got around to testing.
Anyway…I finally got the chance to test it and I must admit the results were pretty good. So here’s how you shrink your reference images:
The DISM tool now contains a bunch of new servicing commands related to the component store (or the WINSxs directory). Most importantly for OS deployment guys a couple of these commands can be leveraged to reduce the size of patched Win 8.1 and Server 2012 R2 images.
What do you need to do?
Before you run a capture of your reference machine run the following command (whilst in Windows):
DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase
The command only takes a few minutes to complete and once complete you can capture your reference image as per usual process.
What are the results like?
I began by running a basic Build and Capture Task Sequence for a Windows 8.1 x64 Enterprise build (including the latest security patches). The captured reference WIM was around 3.76GB.
I then updated my Build and Capture Task Sequence with an additional step to clean-up the component store:
I then re-ran the Task Sequence and the captured image was now down to 3.2GB:
Over 500MB saved…that’s a pretty big deal 🙂
Some caveats to consider:
The command only works on Windows 8.1 and Server 2012 R2.
After running DISM with the “/ResetBase” parameter you cannot go back and uninstall previously installed updates…so make sure you test that new image before deploying!
If you prefer you can drop the “/ResetBase” parameter but the results will not be quite as good.
A bit more info:
If you are interested you can also run the following command to check the status of the Component Store:
DISM /Online /Cleanup-Image /AnalyzeComponentStore