Fix installing updates that were downloaded by Windows but not selected in the script
This commit is contained in:
parent
e1b4c84856
commit
bbc3416508
|
@ -46,10 +46,8 @@ For I = 0 to userUpdatesToApply.Count-1
|
|||
addThisUpdate = false
|
||||
If update.EulaAccepted = false Then
|
||||
update.AcceptEula()
|
||||
addThisUpdate = true
|
||||
Else
|
||||
addThisUpdate = true
|
||||
End If
|
||||
addThisUpdate = true
|
||||
|
||||
If addThisUpdate = true Then
|
||||
WScript.Echo I + 1 & "> adding: " & update.Title
|
||||
|
@ -69,8 +67,8 @@ downloader.Download()
|
|||
Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl")
|
||||
rebootMayBeRequired = false
|
||||
WScript.Echo vbCRLF & "Successfully downloaded updates:"
|
||||
For I = 0 To searchResult.Updates.Count-1
|
||||
set update = searchResult.Updates.Item(I)
|
||||
For I = 0 To userUpdatesToApply.Count-1
|
||||
set update = searchResult.Updates.Item(userUpdatesToApply.Item(I))
|
||||
If update.IsDownloaded = true Then
|
||||
WScript.Echo I + 1 & "> " & update.Title
|
||||
updatesToInstall.Add(update)
|
||||
|
|
Loading…
Reference in New Issue