Thanks
--
Thanks,
Marc Reynolds
Microsoft Technical Support
This posting is provided "AS IS" with no warranties, and confers no rights.
"JLUG...@aol.com" <anon...@discussions.microsoft.com> wrote in message
news:031f01c3c51e$bdbee180$a101...@phx.gbl...
If you don't intend to ever unistall them, simply delete the folders.
If you wish to clean them from Add/Remove Programs, see tip 34 in the 'Tips &
Tricks' at http://www.jsiinc.com
Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
> How can I get rid of those Hot Fixes which are sucking up
> 22 MB chunks of my hard drive?
Hi
Here is a VBScript that will remove the uninstall folder and Add/Remove
Programs
entry for all hotfixes that creates $ntuninstall... folders under the Windows
folders (that means that it will e.g. not remove uninstall information for
Internet Explorer and Outlook Express updates). The script will work on both
Win2k and WinXP.
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 unisntall 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 is now removed:" _
& vbCrLf & UCase(sDeleted)
Else
MsgBox "No updates found to remove the uninstall data for."
End If
--
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/scriptcenter