Skip to content

Instantly share code, notes, and snippets.

@hryamzik
Last active October 19, 2015 11:28
Show Gist options
  • Save hryamzik/b6e242765dc65eb75262 to your computer and use it in GitHub Desktop.
Save hryamzik/b6e242765dc65eb75262 to your computer and use it in GitHub Desktop.
Dim hideupdates(7)
hideupdates(0) = "KB3035583 "
set updateSession = createObject("Microsoft.Update.Session")
set updateSearcher = updateSession.CreateupdateSearcher()
Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'")
For i = 0 To searchResult.Updates.Count-1
set update = searchResult.Updates.Item(i)
For j = LBound(hideupdates) To UBound(hideupdates)
'MsgBox hideupdates(j)
if instr(1, update.Title, hideupdates(j), vbTextCompare) = 0 then
'Wscript.echo "No match found for " & hideupdates(j)
else
Wscript.echo "Hiding " & hideupdates(j)
update.IsHidden = True
end if
Next
Next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment