How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space.
w60 means Windows Vista or Windows Server 2008.
w61 means Windows 7 or Windows Server 2008 R2.
There are various guides found on the internet on how-to integrate updates into Windows installation media using dism.
This article is a post-integrate how-to to this numerous articles.
This article is addressed to users, who are comfortable using dism to mount, update, manage and unmount Windows Image files for deployment of Windows Systems.
So mounting and dismounting images is intentionally left out.
Administrators often include windows update packages into their deployment images to save time when deploying.
In Windows 8 dism.exe has built-in command-line extensions to remove superseded updates from Windows 8 image files.
Earlier versions of Windows do not have this feature.
So when you integrate packages into a windows installation media (w60 or w61), superseded or outdated packages reside in the deployment image and use unneccessary space. This guide shows how to list and remove superseded packages from the command-line or by batch.
Short description for what you have to do before:
- Download Windows Updates for Windows (w60 or w61).
Best practice is using wsus offline update.
- Mount Windows installation media.
- Apply packages to the mounted image.
The listings below offers two options.
The first option (offline) is adressed to manage superseded packages of an already mounted Windows (w60, w61) image.
The second option (online) is addressed to manage superseded packages on an online Windows (w60, w61) system.
Only tested for Win7:
Assuming image is mounted on c:\dism\mount or use online system.
Open elevated command prompt:
List superseded updates from command-line
(Tip: Set command windows size > 150):
dism /image:c:\dism\mount /get-packages /format:table /english | find /i "Superseded"
Write list of superseded updates to textfile:
dism /online /get-packages /format:table /english | find /i "Superseded"
dism /image:c:\dism\mount /get-packages /format:table /english | find /i "Superseded" > c:\packages.txt
Remove all superseded updates:
dism /online /get-packages /format:table /english | find /i "Superseded" > c:\packages.txt
Write "remove-superseded.cmd" with following code.
Please regard escape (^) before pipe (|) in batch.
for /f %%i in ('dism /image:%mnt% /get-packages /format:table /english ^| find /i "Superseded"') do (
dism /image:%mnt% /remove-package /packagename=%%i
for /f %%i in ('dism /online /get-packages /format:table /english ^| find /i "Superseded"') do (
dism /online /remove-package /packagename=%%i
Open elevated command window and run "remove-superseded.cmd".
Now, since all superseded updates are removed, the deployment image will be smaller then before.
Short description for what you can do afterwards:
- Unmount image using dism. Don't forget to use the commit option.
- Compress image using imagex. (ADK or WAIK is needed).