Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Update > Removal of superseeded security fixes in W2ks/W2k3s

Reply
Thread Tools Display Modes

Removal of superseeded security fixes in W2ks/W2k3s

 
 
SpaceSaver
Guest
Posts: n/a

 
      08-18-2005
Question:

HowTo easily get rid of previously installed security fixes that is
superseeded by a new servicepack or security roll-up package ?

Detail:
While applying a new servicepack or security roll-up package there is
normally a bunch of previously installed security fixes that will be replaced
but they will
still remain in their respective "$NTUninstall" folder located within the
"SystemRoot" directory (as well present in the Add/Remove Programs dialog)
and will eventually allocate a rather huge amount of diskspace (to my opinion
rather unnecessary). To my knowledge there is no automatic "clean-up" process
builtin that can be activated when fex. installing a new servicepack, assumed
that rollback to a previous servicepack including security fixes not is
needed.

Platforms:
Windows 2000 Server
Windows Server 2003

 
Reply With Quote
 
 
 
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a

 
      08-18-2005
SpaceSaver wrote:

> Question:
>
> HowTo easily get rid of previously installed security fixes that is
> superseeded by a new servicepack or security roll-up package ?
>
> Detail:
> While applying a new servicepack or security roll-up package there is
> normally a bunch of previously installed security fixes that will be replaced
> but they will
> still remain in their respective "$NTUninstall" folder located within the
> "SystemRoot" directory (as well present in the Add/Remove Programs dialog)
> and will eventually allocate a rather huge amount of diskspace (to my opinion
> rather unnecessary). To my knowledge there is no automatic "clean-up" process
> builtin that can be activated when fex. installing a new servicepack, assumed
> that rollback to a previous servicepack including security fixes not is
> needed.
>
> Platforms:
> Windows 2000 Server
> Windows Server 2003

Hi,

A service pack install will remove the entries in Add/Remove Programs
for the updates it replaces, but it will not delete the uninstall
folders (this in case you uninstall the service pack)

Below is a VBScript (put it in a .vbs file) that I have written that
will remove the uninstall folder (and the Add/Remove Programs entry
if one exists) for all hotfixes that creates $ntuninstall... folders
under the Windows folder.

Note: This will not uninstall the update itself, only the
uninstall folder and the Add/Remove Programs entry.


'--------------------8<----------------------

Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
Set oFolder = oFSO.GetFolder(sWinDir)
Set oDictionary = CreateObject("Scripting.Dictionary")

For Each oSubFolder In oFolder.SubFolders

sFolderName = LCase(oSubFolder.Name)
sFolderPath = LCase(oSubFolder.Path)

If Left(sFolderName, 13) = "$ntuninstallq" _
Or Left(sFolderName, 14) = "$ntuninstallkb" Then

' get the update name for the registry delete
sUpdateName = Mid(sFolderName, 13, Len(sFolderName) - 13)

' never delete folders/files while enumerating a file/folder collection
' adds them to a dictionary object for later handling instead
oDictionary.Add sUpdateName, sFolderPath

End If
Next

sDeleted = ""
For Each sUpdateName In oDictionary.Keys

sDeleted = sDeleted & vbCrLf & sUpdateName
sFolderPath = oDictionary.Item(sUpdateName)

On Error Resume Next
' remove entry in Add/Remove Programs
oShell.RegDelete "HKLM\SOFTWARE\Microsoft\Windows\" _
& "CurrentVersion\Uninstall\" & sUpdateName & "\"
On Error Goto 0

' delete the uninstall folder
oShell.Run "%Comspec% /C RD /S /Q " _
& Chr(34) & sFolderPath & Chr(34), 0, True
Next

If sDeleted <> "" Then
MsgBox "The uninstall data for the following updates are now removed:" _
& vbCrLf & UCase(sDeleted)
Else
MsgBox "No updates found to remove the uninstall data for."
End If

'--------------------8<----------------------






--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dll fixes and registry fixes? Capital Expert Windows Vista General Discussion 2 06-27-2008 02:06 AM
Hot fixes Irene Windows Update 0 09-16-2004 02:17 AM
Re: Hot Fixes Jupiter Jones [MVP] Windows Update 0 09-09-2004 03:30 PM
11/11/2003 security fixes not showing in Windows Update AlexR Windows Update 0 11-26-2003 10:00 AM
Hot fixes bill elliott Windows Update 1 10-30-2003 06:09 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59