JSI Tip 7304. The Windows XP and Windows Server 2003 Prncnfg utility.

Jerold Schulman

October 8, 2003

8 Min Read
ITPro Today logo in a gray background | ITPro Today

When you use the Windows XP CMD help., or Windows Server 2003 CMD help, and press Prncnfg on the New command-line tools page, you see:

Prncnfg.vbs

Configures or displays configuration information about a printer. Used without parameters, prncnfg.vbs displays command-line help for the prncnfg.vbs command.

To display configuration information about a printer

Syntax

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

Parameters

-g Required. Specifies that you want to display configuration information about a printer. -s RemoteComputer Specifies, by name, the remote computer that manages the printer about which you want to display information. If you do not specify a computer, the local computer is used. -p PrinterName Required. Specifies, by name, the printer about which you want to display information. -u UserName -w Password Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer that hosts the printer about which you want to display information. All members of the Administrators group for that computer have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work. For more information on WMI, see Related Topics. /? Displays help at the command prompt.

Remarks

  • This command starts a script that is located in the systemrootsystem32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.

  • If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

Examples

To display configuration information for the printer named ColorPrinter_2 whose print queue is hosted by the remote computer named HRServer, type:

cscript prncnfg.vbs -g -s HRServer -p ColorPrinter_2

To configure a printer

Syntax

cscript prncnfg.vbs -t [-s RemoteComputer] -p PrinterName [-u UserName -w Password] [-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]

Parameters

-t Required. Specifies that you want to configure a printer. -s RemoteComputer Specifies, by name, the remote computer that manages the printer you want to configure. If you do not specify a computer, the printer is configured on the local computer. -p PrinterName Required. Specifies, by name, the printer you want to configure. -u UserName -w Password Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer on which you want to configure a printer. All members of the Administrators group for that computer have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work. For more information on WMI, see Related Topics. -r PortName Specifies 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. For more information, see Related Topics. -l Location Specifies the printer location, such as "Copier Room." -m Comment Specifies the comment string. -h ShareName Specifies the share name. -f SeparatorText Specifies a file that contains the text that appears on the separator page. -y DataType Specifies the data types that the printer can accept. For more information on data types, see Related Topics. -st StartTime Configures the printer for limited availability. Specifies the time of 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. You must specify time as a 24-hour clock. For example, to specify 11 P.M., type 2300. -ut EndTime Configures the printer for limited availability. Specifies the time of day after which the printer is no longer available. If you send a document to a printer when it is unavailable, the document is held (spooled) until the printer becomes available. You must specify time as a 24-hour clock. For example, to specify 11 P.M., type 2300. -o Priority Specifies 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 Specifies the default priority assigned to each print job. {+ | -}shared Specifies whether this printer is shared on the network. {+ | -}direct Specifies whether the document should be sent directly to the printer without being spooled. {+ | -}published Specifies whether this printer should be published in Active Directory. If you publish the printer, other users can search for it based on its location and capabilities, such as color printing and stapling. {+ | -}hidden Reserved function. {+ | -}rawonly Specifies whether only raw data print jobs can be spooled on this queue. {+ | -}queued Specifies that the printer should 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. However, using this option ensures that the whole document is available to the printer. {+ | -}keepprintedjobs Specifies whether the spooler should retain documents after they are printed. Enabling this option allows a user to resubmit a document to the printer from the print queue instead of from the printing program. {+ | -}workoffline Specifies whether you should be able to send print jobs to the print queue even if your computer is not connected to the network. {+ | -}enabledevq Specifies whether 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 Specifies whether the spooler should send to the appropriate queue print jobs with a lower priority that have completed spooling before sending to the same queue print jobs with a higher priority that have not completed spooling. If this option is enabled and no documents have completed spooling, the spooler will send larger documents before smaller ones. You should enable this option if you want to maximize printer efficiency at the cost of job priority. If this option is disabled, the spooler always sends higher priority jobs to their respective queues first. {+ | -}enablebidi Specifies whether the printer sends status information to the spooler. /? Displays help at the command prompt.

Remarks

  • This command starts a script that is located in the systemrootsystem32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.

  • If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

Examples

To configure a printer named ColorPrinter_2 so that the spooler in the remote computer named HRServer keeps print jobs after they have been printed, type:

cscript prncnfg.vbs -t -s HRServer -p ColorPrinter_2 +keepprintedjobs

To change the name of a printer

Syntax

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

Parameters

-x Required. Specifies that you want to change the name of a printer. -s RemoteComputer Specifies, by name, the remote computer that manages the printer you want to rename. If you do not specify a computer, the local computer is used. -p PrinterName Required. Specifies the current printer name. -z NewPrinterName Required. Specifies the new printer name. -u UserName -w Password Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer that hosts the printer you want to rename. All members of the Administrators group for that computer have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work. For more information on WMI, see Related Topics. /? Displays help at the command prompt.

Remarks

  • This command starts a script that is located in the systemrootsystem32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.

  • If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

Examples

To change the name of a printer on the remote computer named HRServer from ColorPrinter_2 to ColorPrinter_3, type:

cscript prncnfg.vbs -x -s HRServer -p ColorPrinter_2 -z ColorPrinter_3



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like