Description
Displays the current status of all printers on the computer.
Strcomputer = " . "
Set Obw.miservice = GetObject ( " Winmgmts: " _
& " {Impersonationlevel = impersonate }! \\ " & Strcomputer & " \ Root \ cimv2 " )
Set Colinstalledprinters = Ob1_miservice. execquery _
( " Select * From win32_printer " )
For Each Objprinter in colinstalledprinters
Wscript. Echo " Name: " & Objprinter. Name
Wscript. Echo " Location: " & Objprinter. Location
Select Case Objprinter. printerstatus
Case 1
Strprinterstatus = " Other "
Case 2
Strprinterstatus = " Unknown "
Case 3
Strprinterstatus = " Idle "
Case 4
Strprinterstatus = " Printing "
Case 5
Strprinterstatus = " Warmup "
End Select
Wscript. Echo " Printer status: " & Strprinterstatus
Wscript. Echo " Server Name: " & Objprinter. servername
Wscript. Echo " Share Name: " & Objprinter. sharename
Wscript. Echo
Next