Hi Elliot,
Give the script below a try. Note that it may take a few moments for the Windows Update, Control Panel item to reflect changes the script makes.
HideUpdates.js
Code:
KB_list = "KB2952664 KB2976978 KB2977759 KB2990214 KB3021917 KB3035583"
KB_list = KB_list.split(' ')
function forceUseCScript() {
if (WScript.FullName.slice(-11).toLowerCase() != 'cscript.exe') {
var WshShell = new ActiveXObject('WScript.Shell')
WshShell.Run('%ComSpec% /k "CScript.exe /nologo ' + '"' + WScript.ScriptFullName + '""', 1, false)
WScript.Quit()
}
}
function promptForElevation() {
if (WshShell.Run('Net Sess', 0, true) != 0) {
new ActiveXObject('Shell.Application').ShellExecute('WScript', '"' + WScript.ScriptFullName + '"', '', 'RunAs', 1)
WScript.Quit()
}
}
function remove_non_numeric(string) {
return string.replace(/\D/g,'')
}
var WshShell = new ActiveXObject('WScript.Shell')
promptForElevation()
forceUseCScript()
KB_successfully_processed = {}
for (i in KB_list) {
KB_successfully_processed[KB_list[i]] = false
}
var WU = new ActiveXObject('Microsoft.Update.Session')
var searcher = WU.CreateUpdateSearcher()
searcher.Online = false
criteria = "IsInstalled=0"
var search_results = searcher.Search(criteria).Updates
list_success = false; list_fail = false
for (i = 0; i < search_results.Count; i++) {
for (j = 0; j < search_results.Item(i).KBArticleIDs.Count; j++) {
for (k in KB_list) {
if (remove_non_numeric(search_results.Item(i).KBArticleIDs(j)) == remove_non_numeric(KB_list[k])) {
try {
//search_results.Item(i).IsHidden = true
WScript.Echo('Hid update ' + KB_list[k])
KB_successfully_processed[KB_list[k]] = true; list_success = true
} catch (e) {
WScript.Echo('Unable to hide update ' + KB_list[k])
list_fail = true
}
}
}
}
}
/*
WScript.Echo('')
if (list_success) {
WScript.Echo('\nUpdates hidden:')
for (i in KB_successfully_processed) {
if (KB_successfully_processed[i]) {WScript.Echo('\t'+i)}
}
}
if (list_fail) {
WScript.Echo('\nUpdates failed to hide:')
for (i in KB_successfully_processed) {
if (!KB_successfully_processed[i]) {WScript.Echo('\t'+i)}
}
}
*/