'First the boilerplate
Set objShell = CreateObject("WScript.Shell")
auclientstate = objShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\AuState")
select case auclientstate
	case 0 aus="the Updates wizard has not run yet -- it waits 24 hours after finding an Internet connection before running."
	case 1 aus="Automatic Updates is waiting for the user to run the AU setup wizard."
	case 2 aus="Automatic Updates is basically idle at the moment.  It has downloaded and installed all of the updates that it found last time and waiting for some time before checking with its update server again."
	case 3 aus="AU has detected available updates and has asked the user if it can update them but the user either hasn't responded or hasn't allowed it yet."
	case 4 aus="Downloading patch(es) right now."
	case 5 aus="AU has downloaded patches to the WUTemp directory and is waiting to install them.  It is either waiting for approval from the user via the Automatic Updates user interface, or it is waiting for the scheduled hour of day to begin installing."
	case 6 aus="Patches installed."
	case 7 aus="Disabled."
	case 8 aus="Patches installed that need a reboot but the user told Auto Updates not to reboot; AU will do nothing until the next reboot."	
	case else aus="Unknown value=" & auclientstate & "."
end select
wscript.echo aus
 

