Prevent Add/Remove Programs

  • Thread starter Thread starter Ken VdB
  • Start date Start date
K

Ken VdB

Hi everyone,

Is there some way I can prevent Windows Update from adding everything it
installs to the "Add/Remove Programs" list? I want to use it to keep my
server and workstations current with critical patches but I don't want all
the "Windows Hotfix see KBxxxxx" entries in Add/Remove Programs. I am never
going to un-install these updates anyway.

Ideally is there some way to prevent Windows Update from even preserving the
uninstall information (the backed-up files).

Thanks,

Ken.
 
If you are using the Windows XP operating system:

Removes Hotfix Backup files and the Add/Remove Programs Registry Entries
http://www.dougknox.com/xp/utils/xp_hotfix_backup.htm

[Coutesy of MS-MVP Doug Knox]


--
Carey Frisch
Microsoft MVP
Windows XP - Shell/User

-------------------------------------------------------------------------------------------


| Hi everyone,
|
| Is there some way I can prevent Windows Update from adding everything it
| installs to the "Add/Remove Programs" list? I want to use it to keep my
| server and workstations current with critical patches but I don't want all
| the "Windows Hotfix see KBxxxxx" entries in Add/Remove Programs. I am never
| going to un-install these updates anyway.
|
| Ideally is there some way to prevent Windows Update from even preserving the
| uninstall information (the backed-up files).
|
| Thanks,
|
| Ken.
 
Mercury said:
Do you know of such a program for Windows 2000 professional? Thanks.

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
 
Thanks : ) !

Torgeir Bakken (MVP) said:
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
 
Oh, that's really good. Thanks!

Torgeir Bakken (MVP) said:
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
 
Back
Top