The following VBScript uses WMI to connect to the PC and list all of the print queues on your local Windows machine. To query a remote machine, just type that machine's name in place of the
. in the
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer")
For Each objPrinter in colPrinters
If objPrinter.Attributes And 64 Then
strPrinterType = "Local"
strPrinterType = "Network"
Wscript.Echo objPrinter.Name & " -- " & strPrinterType
To remove a printer from a machine use something like:
Set objNet = CreateObject("WScript.Network")
For more info see MS TechNet: Managing Network Printers.
Bear in mind that some printers may be installed at the system level, and available to all users all the time, but on client PCs queues might only be installed in the user's profile and only available to their account, while they're logged in.