Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get default printer name from command line?

Microsoft Windows XP comes with a VBS script to manage local and network printers from the command line:

To Get the default printer details from command line:

cscript C:\windows\system32\prnmngr.vbs -g

To Get the list of printers added to the system from Windows command line:

cscript C:\windows\system32\prnmngr.vbs -l

Is there any equivalent commands for Windows 7? I just need to get the default printer details and get the list of printers attached to the system.

like image 488
Kimi Avatar asked Nov 09 '12 15:11

Kimi


People also ask

How do I find the default printer name?

Select Start > Settings . Go to Devices > Printers & scanners > select a printer > Manage. Then select Set as default.

How do I find the default printer in Linux?

To find the default printer just type lpq . This will show the status for default printer including the location. If you want to change you default printer run lpoptions -d printername where printername is the name of the printer you want Asto make the default.


1 Answers

List of all printers names and shows default one (You can get more details read documentation)

wmic printer get name,default

If you want output to file use:

wmic printer get name,default > D:\catalog\file.txt

Availability

The wmic command is an external command that is available in the below Microsoft operating systems as wmic.exe.

Windows XP professional
Windows 2003
Windows Vista
Windows 7
Windows 8
Windows 10
like image 154
Maciej Pulikowski Avatar answered Sep 18 '22 12:09

Maciej Pulikowski