<

Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x

Remove superseded updates in Windows 7

Published on
5,882 Points
2,782 Views
1 Endorsement
Last Modified:
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.

Problem:
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):

rem offline
dism /image:c:\dism\mount /get-packages /format:table /english | find /i "Superseded"

Open in new window


rem online
dism /online /get-packages /format:table /english | find /i "Superseded"

Open in new window

Write list of superseded updates to textfile:

dism /image:c:\dism\mount /get-packages /format:table /english | find /i "Superseded" > c:\packages.txt
notepad.exe c:\packages.txt

Open in new window


dism /online /get-packages /format:table /english | find /i "Superseded" > c:\packages.txt
notepad.exe c:\packages.txt

Open in new window


Remove all superseded updates:
Write "remove-superseded.cmd" with following code.
Please regard escape (^) before pipe (|) in batch.
@echo off
set mnt="c:\dism\mount"
for /f %%i in ('dism /image:%mnt% /get-packages /format:table /english ^| find /i "Superseded"') do (
echo %%i
dism /image:%mnt% /remove-package /packagename=%%i
)

Open in new window


@echo off
for /f %%i in ('dism /online /get-packages /format:table /english ^| find /i "Superseded"') do (
echo %%i
dism /online /remove-package /packagename=%%i
)

Open in new window

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).
 
1
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
0 Comments

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Join & Write a Comment

The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month