prncnfg | new in WS2003 |
Displays information about printers and configures them.
prncnfg -g -s RemoteComputer -p PrinterName prncnfg -t -s RemoteComputer -p PrinterName [-r PortName ] [-h ShareName ] [-i DefaultPriority ] ... [{+ -}{direct published shared workoffline ...}]
Displays printer settings
Name of print server.
Configures printer.
Name of printer.
COM, LPT, or TCP/IP port of printer.
Share name of printer.
Default priority for new jobs.
Prints directly to printer (doesn't spool).
Publishes printer in Active Directory.
Shares printer on network.
Users can submit jobs to print queue even if their computers are offline.
Display information about printer named SalesPrinter managed by local computer:
prncnfg -g -p SalesPrinter Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Server name Printer name SalesPrinter Share name Driver name HP Color LaserJet Port name LPT1: Comment Location Separator file Print processor WinPrint Data type RAW Parameters Priority 1 Default priority 0 Printer always available Attributes local shared published enable_bidi do_complete_first Printer status Idle Extended printer status Unknown Detected error state Unknown Extended detected error state Unknown
Share SalesPrinter with share name SPRT :
prncnfg -t -p SalesPrinter -h SPRT +shared Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Configured printer SalesPrinter
Verify the result:
prncnfg -g -p SalesPrinter Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Server name Printer name SalesPrinter Share name SPRT <---NOTE Driver name HP Color LaserJet Port name LPT1: Comment Location Separator file Print processor WinPrint Data type RAW Parameters Priority 1 Default priority 0 Printer always available Attributes local shared enable_bidi do_complete_first Printer status Idle Extended printer status Unknown Detected error state Unknown Extended detected error state Unknown
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 , prndrvr , prnjobs , prnmngr , prnport , prnqctl