Windows Update - Review your update history question

G

Guest

I would like to get rid of the "Cancelled" and "Failed" entries in the
Windows Update - Review your update history, because they are finally all
corrected installed.

How can i remove these enries from the history?

Guy
 
P

PA Bear

1. Does their presence there cause your machine problems? NB: That data is
not on your machine.

2. Is Windows Update or Automatic Update still telling you that some updates
are not installed?
 
G

Guest

No all updates are installed, therefore it is much cleanerthat earlier faled
and cancelled entries could be removed from the list.

Guy
 
T

Torgeir Bakken \(MVP\)

Guy said:
I would like to get rid of the "Cancelled" and "Failed" entries in the
Windows Update - Review your update history, because they are finally all
corrected installed.

How can i remove these enries from the history?
Hi,

You cannot, the only option is to clear out all the history
information, or nothing.

Using the VBScript below, you can get a report that only contains
the log entries that contains successfully installed updates.

Put the script in a text file with file extension .vbs (e.g.
WU_HistorySuccess.vbs) and run it by double-clicking on it.


'--------------------8<----------------------
' Script that reports only successfully installed updates (that are
' installed with Windows Update v5 or newer technology).
'
' Result will be written to %temp%\UpdateHistorySuccess.txt
' and then launched in Notepad
'
' Author: Torgeir Bakken
' Date 2005-07-02
'
Option Explicit

Const OverwriteIfExist = -1
Const OpenAsASCII = 0

Dim oWU, iTHCount, colUpdate, oUpdate, sStatus, iTotal
Dim iSuccess, iFailed, iAborted, iUnknown, sErrorCode
Dim oFSO, oShell, sFile, f

On Error Resume Next
Set oWU = CreateObject("Microsoft.Update.Searcher")

If Err.Number <> 0 Then
MsgBox "WU programming interface does not exist.", _
vbInformation + vbSystemModal, "Update history"
WScript.Quit
End If
On Error Goto 0

iTHCount = oWU.GetTotalHistoryCount
If iTHCount > 0 Then

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("Wscript.Shell")
sFile = oShell.ExpandEnvironmentStrings("%TEMP%") _
& "\UpdateHistorySuccess.txt"
Set f = oFSO.CreateTextFile(sFile, _
OverwriteIfExist, OpenAsASCII)

iTotal = 0
iSuccess = 0
iFailed = 0
iAborted = 0
iUnknown = 0

f.WriteLine "Report on successfully installed updates, run at " & Now
f.WriteLine "---------------------------------" _
& "---------------------------------"

Set colUpdate = oWU.QueryHistory(0, iTHCount)

For Each oUpdate In colUpdate

sErrorCode = ""
Select Case oUpdate.ResultCode
Case 2
sStatus = "Succeeded"
iSuccess = iSuccess + 1
f.WriteLine "Title:" & vbTab & vbTab & vbTab & oUpdate.Title
f.WriteLine "Description:" & vbTab & vbTab & oUpdate.Description
f.WriteLine "Date/Time in GMT:" & vbTab & oUpdate.Date
f.WriteLine "Install mechanism:" & vbTab _
& oUpdate.ClientApplicationID
f.WriteLine "---------------------------------" _
& "---------------------------------"

Case 4
sStatus = "Failed"
iFailed = iFailed + 1
sErrorCode = oUpdate.UnmappedResultCode
Case 5
sStatus = "Aborted"
iAborted = iAborted + 1
Case Else
sStatus = "Unknown"
iUnknown = iUnknown + 1
End Select

iTotal = iTotal + 1
Next

f.WriteLine
f.WriteLine "Total number of update log entries found: " & iTotal
f.WriteLine "Number of log entries with status success: " & iSuccess
f.WriteLine "Number of log entries with status failed: " & iFailed _
& " (not shown in list above!)"
f.WriteLine "Number of log entries with status aborted: " & iAborted _
& " (not shown in list above!)"
f.WriteLine "Number of log entries with status unknown: " & iUnknown _
& " (not shown in list above!)"

f.Close
oShell.Run "notepad.exe " & """" & sFile & """", 1, False
Else

MsgBox "No entries found in Update History.", _
vbInformation + vbSystemModal, "Update history"

End If
'--------------------8<----------------------
 
T

Torgeir Bakken \(MVP\)

PA said:
1. Does their presence there cause your machine problems?
NB: That data is not on your machine.
Hi,

Actually, if you have the Windows Update v5 or newer client component
installed, the data is on your machine.

It is stored in the database file
C:\Windows\SoftwareDistribution\DataStore\DataStore.edb

In the link below is a VBScript that outputs all the installation
history to a text file.

"View Installation History" for WU5 without using the WU Web site
http://groups.google.co.uk/group/mi...pdate/msg/dee85221176110ad?dmode=source&hl=en
 
G

Guest

hi,
thx for the answer.
i suppose it isn't a good idea to clear out all history information?
what are the consequences of this and how can one clear out all this
information?

Guy
 
T

Torgeir Bakken \(MVP\)

Guy said:
hi,
thx for the answer.
i suppose it isn't a good idea to clear out all history
information? what are the consequences of this and how can
one clear out all this information?
Hi,

The only consequence is that you have no more old update history to
look at.

To clear the history, you can delete the folder
%windir%\SoftwareDistribution\DataStore\

(%windir% is typically C:\Windows or C:\Winnt)

Note that you will need to stop the "Automatic Updates" service before
you are allowed to delete this folder, e.g by doing the following:

Start/Run --> services.msc

Then find "Automatic Updates" in the list, and double click on it.

If the service status is "Started", press the Stop button.

You can now delete the DataStore folder.
 

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