Posted On 2007-04-24 by FortyPoundHead
Keywords: Command Reference
Tags: Windows Commandline Tutorial Tip Windows
Views: 2674

Display, configure or rename a printer.

To display configuration information about a printer:

cscript prncnfg.vbs -g [-s RemoteComputer]
-p PrinterName 
[-u UserName -w Password] 

To configure a printer:

cscript prncnfg.vbs -t [-s RemoteComputer]
-p PrinterName [-r PortName] [-l Location]
[-m Comment] [-h ShareName] [-f SeparatorText]
[-y DataType] [-st StartTime] [-ut EndTime] [-o Priority]
[-i DefaultPriority] [{+ | -}shared] [{+ | -}direct]
[{+ | -}published] [{+ | -}hidden] [{+ | -}rawonly]
[{+ | -}queued] [{+ | -}keepprintedjobs]
[{+ | -}workoffline] [{+ | -}enabledevq]
[{+ | -}docompletefirst][{+ | -}enablebidi]

To change the name of a printer

cscript prncnfg.vbs -x [-s RemoteComputer]
-p PrinterName -z NewPrinterName
[-u UserName -w Password] 


-s RemoteComputer 
The name of the remote computer that manages the printer. 

-p PrinterName 
The name of the printer.

-u UserName -w Password 
An account with permission to connect WMI services to the computer
that hosts the printer. e.g. A member of the Administrators group. 

-r PortName 
The port to which the printer is connected.
If this is a parallel or a serial port, then use the ID of the port
(for example, LPT1 or COM1). If this is a TCP/IP port, then use the
port name that was specified when the port was added. 

-l Location 
The printer location, such as "Copier Room." 

-m Comment 
A comment string. 

-h ShareName 
The share name. 

-f SeparatorText 
A file that contains the text that appears on the separator page. 

-y DataType 
Data types that the printer can accept. 

-st StartTime 
Specify a time of the day after which the printer is available.
If you send a document to a printer when it is unavailable, the
document is held (spooled) until the printer becomes available.
Specify time as a 24-hour clock. e.g. 2300

-ut EndTime 
Specify a time of the day after which the printer is no longer available.

-o Priority 
A priority that the spooler uses to route print jobs.
A print queue with a higher priority receives all its
jobs before any queue with a lower priority. 

-i DefaultPriority 
The default priority assigned to each print job. 

{+ | -}shared 
Is this printer is shared on the network. 

{+ | -}direct 
Is the document to be sent directly to the printer without being spooled. 

{+ | -}published 
Is this printer to be published in Active Directory.
If you publish a printer, other users can search for it based on its location
and capabilities, such as color printing and stapling.

{+ | -}hidden 
Reserved function.

{+ | -}rawonly 
Are only raw data print jobs to be spooled on this queue. 

{+ | -}queued 
Do not begin to print until after the last page of the document is spooled.
The printing program is unavailable until the document has finished printing.
This option ensures that the whole document is available to the printer.

{+ | -}keepprintedjobs 
Retain documents after they are printed.
Allows a user to resubmit a document to the printer from the print queue. 

{+ | -}workoffline 
Allow sending print jobs when computer is not connected to the network. 

{+ | -}enabledevq 
Print jobs that do not match the printer setup (for example, PostScript files
spooled to non-PostScript printers) should be held in the queue rather than 
being printed. 

{+ | -}docompletefirst 
Allocate jobs to a printer as soon as thay are spooled.
If this option is disabled, the spooler always sends higher priority
jobs to their respective queues first.
You should enable this option if you want to maximize printer efficiency
at the cost of job priority. 

{+ | -}enablebidi 
Send bi-directional status information to the spooler.

To get online help for this .VBS Script change to the directory (CD) where
it''s installed (\windows\system32) and run PRNCNFG -?

About the Author

FortyPoundHead has posted a total of 1974 articles.

Comments On This Post

No comments on this post yet!

Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.

Your IP address is:

Before you can post, you need to prove you are human. If you log in, this test goes away.

Code Links