Skip to content

Instantly share code, notes, and snippets.

@NaPs
Created June 16, 2009 13:20
Show Gist options
  • Save NaPs/130679 to your computer and use it in GitHub Desktop.
Save NaPs/130679 to your computer and use it in GitHub Desktop.
Const reading = 1
Const writing = 2
set wmi_service = getobject("winmgmts:" & "{impersonationLevel=impersonate}!\\"& strComputer &"\root\cimv2")
set processes = wmi_service.execquery("select * from Win32_Process")
update_process_counter = 0
foreach process in processes
if process.name = "wuauclt.exe" then
update_process_counter = update_process_counter + 1
end if
next
if update_process_counter > 0 then
wscript.echo "There are Windows updates available."
wscript.quit(1)
end if
wscript.echo "No Windows Updates found."
wscript.quit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment