Michael W wrote:
> Hi Patty...
>
> The option "Notify Me", doesn't "Disable Automatic Update". And if I
> understand right, "Turn Automatic Update Off" doesn't either.
>
> Can the service Automatic Updates, be "Disabled" ? (Previously, I had kept
> the service set to "Manual", but found Automatic Updates turned on sometimes.
> (The Update Web Site Home has a "Turn On Automatic Updates" button, for
> example).
Note that if you disable the Automatic Updates service, you will not
be able to use Windows Update web site either.
> I thus have updates in different places (where Auto Up was storing, keeping
> them, in %WINDIR%\SoftwareDistribution). And also as hidden, compressed
> folders under %WINDIR%, "$NtUninstallKB896727-IE6SP1-20050719.165959$" for
> example.
>
> I also see in Add/Remove Programs, many listed (some correpond, some don't).
>
> I wish to clean all this out.
>
> I believe I can delete the (hidden, compressed) folders: currently have 20
> of them, 122 MB.
>
> Can the "SoftwareDistribution" folder also be removed? This currenlty 25 MB,
> with sub folders "DataStore", "Download", "SelfUpdate", "WebSetup",
> "WuRedir". The "Download" had in it items that boil down to things like
> "Windows2000-KB899587-x86-ENU.psm", where Auto Update was getting ready...
> (or so I think).
After all updates are finished installing, you can safely delete all
folders/files in the ...\SoftwareDistribution\Download\ folder (the
system should delete the files automatically 10 days after the
installation though).
As long as you doesn't care about not being able to uninstall the
updates anymore, all the $ntuninstall... folders can be deleted.
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