List Printer Capabilities

Lists properties and capabilities for all the printers installed on a computer.

 
 
 
 
 
(0)
Add to favorites
Printing
8/10/2009
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Better version of this script
    1 Posts | Last post September 12, 2015
    • Just whipped this up for someone who referenced your post...
      http://www.visualbasicscript.com/tm.aspx?high=&m=107335&mpage=1#107407
      
      If Instr(1, WScript.FullName, "CScript", vbTextCompare) = 0 Then  
      	With CreateObject("WScript.Shell")  
      		.Run "cmd.exe /k cscript //nologo """ & WScript.ScriptFullName & """", 1, False  
      		WScript.Quit  
      	End With  
      End If  
      
      strComputer = "." 
      
      Dim objWMIService, colInstalledPrinters
      Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 
      Set colInstalledPrinters =  objWMIService.ExecQuery("Select * from Win32_Printer") 
       
      Dim objPrinter
       
      For Each objPrinter in colInstalledPrinters 
      	Dim Property_
      	For Each Property_ in objPrinter.Properties_
      		Select Case TypeName(objPrinter.Properties_(Property_.Name).Value) 
      			Case "Null"
      				WScript.Echo  Property_.Name & ": Null"
      			Case "Boolean"
      				WScript.Echo  Property_.Name & ": " & objPrinter.Properties_(Property_.Name).Value
      			Case "String"
      				WScript.Echo  Property_.Name & ": " & objPrinter.Properties_(Property_.Name).Value
      			Case "Long"
      				WScript.Echo  Property_.Name & ": " & objPrinter.Properties_(Property_.Name).Value
      			Case "Variant()"
      				Dim subProperty
      				WScript.Echo Property_.Name & ":"
      				
      				For Each subProperty In objPrinter.Properties_(Property_.Name).Value
      					WScript.Echo vbTab & Property_.Name & ": " & subProperty
      				Next
      			Case Else
      				WScript.Echo Property_.Name & ": UNKOWN TYPE"
      		End Select
      		
          Next
      Next