Add, delete and list printers and printer connections, can also display or set the default printer.
Syntax cscript PRNMNGR.vbs [-options] [-s server][-p printer_name][-m driver model] [-r port][-u user_name][-w password] Options -l list printers -a add local printer -ac add printer connection -g get the default printer -t set the default printer -d delete printer -x delete all printers
Examples
Set _scripts=cscript %Windir%\System32\Printing_Admin_Scripts\en-US
:: add printer
%_scripts%\prnmngr.vbs -a -p "printer" -m "driver" -r "lpt1:"
:: delete printer
%_scripts%\prnmngr.vbs -d -p "printer" -s server
:: connect to printer
%_scripts%\prnmngr.vbs -ac -p "\\server\printer"
:: delete connection
%_scripts%\prnmngr.vbs -d -p "\\server\printer"
:: delete all printers
%_scripts%\prnmngr.vbs -x -s server
:: List all printers
%_scripts%\prnmngr.vbs -l -s server
:: List a specific printer
%_scripts%\prnmngr.vbs -l |find "Printer name"
:: get the DEFAULT printer
%_scripts%\prnmngr.vbs -g
:: Set the DEFAULT printer
%_scripts%\prnmngr.vbs -t -p "\\server\printer"
Prnmngr.vbs is not be included in the Windows PATH but will be found at %Windir%\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs“We photographers deal in things which are continually vanishing, and when they have vanished there is no contrivance on earth can make them come back again. We cannot develop and print a memory” ~ Henri Cartier-Bresson
Related:
NET VIEW \\Printserver - to view a list of available printers.
NET PRINT - View and Delete print jobs.
PRNCNFG - Add, delete, or list printers / connections, set the default printer.
PRNDRVR - Add, delete or list printer drivers.
PRNJOBS - Pause, resume, cancel, or list print jobs.
PRNPORT - Create, delete, or list TCP/IP printer ports, change port configuration.
PRNQCTL - Print a test page, pause or resume a printer, clear a printer queue.
PRINT - Print a text file.
RUNDLL32 - Install/Remove Printers (plus advanced options).
WMIC PRINTER - Set printing options through WMI.
Q246868 - TCP/IP Printing options in the Windows Standard Port Monitor.
Add printer - .AddPrinterConnection
Add Network printer - .AddWindowsPrinterConnection
List printers - .EnumPrinterConnections
Set default printer - .SetDefaultPrinter
Equivalent bash command (Linux): lpc - Line printer control program.