prnmngr | new in WS2003 |
prnmngr -a [-s RemoteComputer] -p PrinterName -m DriverName -r PortName prnmngr -d [-s RemoteComputer] -p PrinterName prnmngr {-l | -x} [-s RemoteComputer] prnmngr {-ac | -t} -p PrinterName prnmngr -g
-a
Adds a local printer
-d
Deletes a printer
-l
Lists all printers
-x
Deletes all printers
-ac
Adds a printer connection
-t
Specifies the default printer
-g
Displays the default printer
-s RemoteComputer
Name of print server
-p PrinterName
Name of printer
-m DriverName
Name of printer driver
-r PortName
COM, LPT, or TCP/IP port of printer
List all printers on the local computer:
prnmngr -l Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Server name Printer name HP LaserJet 1200 Series PCL 6 on dizzy (from SNOOPY) in session 1 Share name Driver name HP LaserJet 1200 Series PCL 6 Port name TS005 Comment Location Print processor WinPrint Data type RAW Parameters Attributes 33348 Priority 1 Default priority 0 Average pages per minute 0 Printer status Idle Extended printer status Unknown Detected error state Unknown Extended detected error state Unknown Server name Printer name SalesPrinter Share name SPRT Driver name HP Color LaserJet Port name LPT1: Comment Location Print processor WinPrint Data type RAW Parameters Attributes 2632 Priority 1 Default priority 0 Average pages per minute 0 Printer status Idle Extended printer status Unknown Detected error state Unknown Extended detected error state Unknown Number of local printers and connections enumerated 2
Display the default printer:
prnmngr -g Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. The default printer is HP LaserJet 1200 Series PCL 6 on dizzy (from SNOOPY) in session 1
Change the default printer to
SalesPrinter :
prnmngr -t -p SalesPrinter Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. The default printer is now SalesPrinter
This command is a
.vbs script and requires CScript to run. You can make CScript your default script host by typing the following at the command prompt:
cscript //h:cscript //s
This command requires Administrator credentials. If logged on with different credentials, use -u UserName -w Password to specify suitable credentials.
Printing , prncnfg, prndrvr, prnjobs, prnqctl