Prevent Add/Remove Programs

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.
 
C

Carey Frisch [MVP]

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.
 
T

Torgeir Bakken (MVP)

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
 
M

Mercury

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
 
K

Ken VdB

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top