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.
Select Start > Settings . Go to Devices > Printers & scanners > select a printer > Manage. Then select Set as default.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With