Http://www.mums.ac.ir/shares/hit/eduhit/book/windowsscripting.pdf
Http://support.microsoft.com/kb/926352/en-us
https://www.microsoft.com/learning/en-us/book.aspx?id=6789
Filterprinterstatus.vbs
Option Explicit ' on Error Resume nextdim strcomputerdim wminsdim wmiquerydim objwmiservicedim colitemsdim Objitemdim strSt Atusstrcomputer = "." Wmins = "\root\cimv2" wmiquery = "SELECT * from Win32_Printer" _& "Where printerstatus = 1" _& "or Printerstatus = 2 "_&" or Printerstatus = 7 "Set objWMIService = GetObject (" winmgmts:\\ "_& StrComputer & wmins) Set colitems = objWMIService.ExecQuery (wmiquery) If colitems.count = 0 Thenwscript.echo "All printers is fine" elsefor each objitem in Colitemswscript.echo "Name:" & ObjItem.NameWScript.Echo "Location:" & ObjItem.LocationsubEvalStatusWScript.Echo "Printer Status:" & Strstatuswscript.echo "Server Name:" & ObjItem.ServerNameWScript.Echo "Share Name:" & objItem.ShareNameWScript.EchoNextEnd ifsub Subevalstatusselect Case Objitem.printerstatuscase 1strStatus = ' other ' case 2strStatus = ' Unknown ' case 3strStatus = ' Idle ' case 4strStatus = "P Rinting "Case 5strStatus =" warmup "Case 6strStatus =" Stopped PriNting "Case 7strStatus =" Offline "End selectend Sub