Ty Flo
Ty Flo

Reputation: 55

How to parse WMIC printer list full

When I use the following command, it outputs a text file with a computer's printer information: wmic printer list full >> c:\computer_printers.txt

However, the list is very long, and I only want to see the fields for DriverName, Name, and Portname in the output. Is there a way to modify the command I am using to get this result?

I researched the adverbs associated with the verb List, but the way I am interpreting the document here (https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx), it does not seem like what I am trying to do is possible. Is there anyone with more experience with WMIC that can confirm this?

Upvotes: 3

Views: 17798

Answers (1)

DavidPostill
DavidPostill

Reputation: 7921

I only want to see the fields for DriverName, Name, and Portname in the output

Use the following command:

wmic printer get DriverName, Name, Portname >> c:\computer_printers.txt

Example output:

> type c:\computer_printers.txt
DriverName                       Name                             PortName
Microsoft XPS Document Writer    Microsoft XPS Document Writer    XPSPort:
Microsoft Shared Fax Driver      Fax                              SHRFAX:
EPSON Stylus Photo RX560 Series  EPSON Stylus Photo RX560 Series  USB001
CutePDF Writer                   CutePDF Writer                   CPW2:

Further Reading

Upvotes: 6

Related Questions