MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
January
Sun Mon Tue Wed Thu Fri Sat
         
9
           
2016
Months
Jan


Sat, Jan 09, 2016 11:05 pm

WMIC printer get

The Windows Management Instrumentation Command-line (WMIC) can be used to query the available printers for a system using wmic printer get. Parameters the command accepts are shown below:

c:\>wmic printer get /?

Property get operations.
USAGE:

GET [<property list>] [<get switches>]
NOTE: <property list> ::= <property name> | <property name>,  <property list>

The following properties are available:
Property                                Type                    Operation
========                                ====                    =========
Attributes                              N/A                     N/A
Availability                            N/A                     N/A
AvailableJobSheets                      N/A                     N/A
AveragePagesPerMinute                   N/A                     N/A
Capabilities                            N/A                     N/A
CapabilityDescriptions                  N/A                     N/A
Caption                                 N/A                     N/A
CharSetsSupported                       N/A                     N/A
Comment                                 N/A                     N/A
ConfigManagerErrorCode                  N/A                     N/A
ConfigManagerUserConfig                 N/A                     N/A
CurrentCapabilities                     N/A                     N/A
CurrentCharSet                          N/A                     N/A
CurrentLanguage                         N/A                     N/A
CurrentMimeType                         N/A                     N/A
CurrentNaturalLanguage                  N/A                     N/A
CurrentPaperType                        N/A                     N/A
Default                                 N/A                     N/A
DefaultCapabilities                     N/A                     N/A
DefaultCopies                           N/A                     N/A
DefaultLanguage                         N/A                     N/A
DefaultMimeType                         N/A                     N/A
DefaultNumberUp                         N/A                     N/A
DefaultPaperType                        N/A                     N/A
DefaultPriority                         N/A                     N/A
Description                             N/A                     N/A
DetectedErrorState                      N/A                     N/A
DeviceID                                N/A                     N/A
Direct                                  N/A                     N/A
DoCompleteFirst                         N/A                     N/A
DriverName                              N/A                     N/A
EnableBIDI                              N/A                     N/A
EnableDevQueryPrint                     N/A                     N/A
ErrorCleared                            N/A                     N/A
ErrorDescription                        N/A                     N/A
ErrorInformation                        N/A                     N/A
ExtendedDetectedErrorState              N/A                     N/A
ExtendedPrinterStatus                   N/A                     N/A
Hidden                                  N/A                     N/A
HorizontalResolution                    N/A                     N/A
InstallDate                             N/A                     N/A
JobCountSinceLastReset                  N/A                     N/A
KeepPrintedJobs                         N/A                     N/A
LanguagesSupported                      N/A                     N/A
LastErrorCode                           N/A                     N/A
Local                                   N/A                     N/A
Location                                N/A                     N/A
MarkingTechnology                       N/A                     N/A
MaxCopies                               N/A                     N/A
MaxNumberUp                             N/A                     N/A
MaxSizeSupported                        N/A                     N/A
MimeTypesSupported                      N/A                     N/A
Name                                    N/A                     N/A
PNPDeviceID                             N/A                     N/A
PaperSizesSupported                     N/A                     N/A
PortName                                N/A                     N/A
PowerManagementCapabilities             N/A                     N/A
PowerManagementSupported                N/A                     N/A
PrintJobDataType                        N/A                     N/A
PrintProcessor                          N/A                     N/A
PrinterPaperNames                       N/A                     N/A
PrinterState                            N/A                     N/A
PrinterStatus                           N/A                     N/A
SeparatorFile                           N/A                     N/A
ServerName                              N/A                     N/A
ShareName                               N/A                     N/A
SpoolEnabled                            N/A                     N/A
StartTime                               N/A                     N/A
Status                                  N/A                     N/A
StatusInfo                              N/A                     N/A
SystemName                              N/A                     N/A
TimeOfLastReset                         N/A                     N/A
UntilTime                               N/A                     N/A
VerticalResolution                      N/A                     N/A

The following GET switches are available:

/VALUE                       - Return value.
/ALL(default)                - Return the data and metadata for the attribute.
/TRANSLATE:<table name>      - Translate output via values from <table name>.
/EVERY:<interval> [/REPEAT:<repeat count>] - Returns value every (X interval) se
conds, If /REPEAT specified the command is executed <repeat count> times.
/FORMAT:<format specifier>   - Keyword/XSL filename to process the XML results.

NOTE: Order of /TRANSLATE and /FORMAT switches influences the appearance of outp
ut.
Case1: If /TRANSLATE precedes /FORMAT, then translation of results will be follo
wed by formatting.
Case2: If /TRANSLATE succeeds /FORMAT, then translation of the formatted results
 will be done.

Some parameters may yield similar results, e.g., the results of a query for DeviceID, DriverName, and Name on one system are shown below:

c:\>wmic printer get DeviceID, Name
DeviceID                             Name
Send To OneNote 2010                 Send To OneNote 2010
Ricoh Aficio MP C2500 PCL5c          Ricoh Aficio MP C2500 PCL5c
Microsoft XPS Document Writer        Microsoft XPS Document Writer
HP Photosmart 6510 series (Network)  HP Photosmart 6510 series (Network)
HP Deskjet 6940 series               HP Deskjet 6940 series
Fax                                  Fax
Adobe PDF                            Adobe PDF

c:\>wmic printer get DeviceID, DriverName
DeviceID                             DriverName
Send To OneNote 2010                 Send To Microsoft OneNote 2010 Driver
Ricoh Aficio MP C2500 PCL5c          Ricoh Aficio MP C2500 PCL5c
Microsoft XPS Document Writer        Microsoft XPS Document Writer
HP Photosmart 6510 series (Network)  HP Photosmart 6510 series
HP Deskjet 6940 series               HP Deskjet 6940 series
Fax                                  Microsoft Shared Fax Driver
Adobe PDF                            Adobe PDF Converter

If I want to check the IP address for a printer, I can use PortName.

c:\>wmic printer get DeviceID, PortName
DeviceID                             PortName
Send To OneNote 2010                 nul:
Ricoh Aficio MP C2500 PCL5c          192.168.0.90
Microsoft XPS Document Writer        XPSPort:
HP Photosmart 6510 series (Network)  192.168.0.21
HP Deskjet 6940 series               192.168.0.9
Fax                                  SHRFAX:
Adobe PDF                            Documents\*.pdf


c:\>

If I just want the IP address for a particular printer I can specify it with where DeviceId="printer_deviceid PortName where printer_deviceid is that printer's device ID. I could also query based on Name, DriverName, etc.

c:\>wmic printer where DeviceID="HP Deskjet 6940 series" get PortName
PortName
192.168.0.9

To check the horizontal and vertical resolution, I can use HorizontalResolution and VerticalResolution:

c:\>wmic printer get DeviceID, HorizontalResolution, VerticalResolution
DeviceID                             HorizontalResolution  VerticalResolution
Send To OneNote 2010                 600                   600
Ricoh Aficio MP C2500 PCL5c          600                   600
Microsoft XPS Document Writer        600                   600
HP Photosmart 6510 series (Network)  600                   600
HP Deskjet 6940 series               600                   600
Fax                                  200                   200
Adobe PDF                            1200                  1200

If I want to see a sharename for a printer, i.e., the name used for a printer that is a shared resource for other computers on the network, I can use the ShareName parameter. E.g., the results for such a command issued on a Windows Server 2012 system showing a printer shared from another system in the Windows domain for which it is the domain controller:

C:\Users\Admin>wmic printer where portname="LPT3:" get deviceid, sharename
DeviceID                                                       ShareName
\\MERGENTHALER.IMAGINATION.local\HP LaserJet 5100 Series PCL6  CSR_HP_5100


C:\Users\Admin>

[/os/windows/commands/wmic] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo