Megosztás a következőn keresztül:


Prncnfg.vbs

 

Applies To: Windows Vista, Windows Server 2008, Windows Server 2012, Windows 8

Configures or displays configuration information about a printer.

For examples of how this command can be used, see Examples.

Syntax

Cscript Prncnfg {-g | -t | -x | -?} [-S <ServerName>] [-P <PrinterName>] [-z <NewPrinterName>] [-u <UserName>] [-w <Password>] [-r <PortName>] [-l <Location>] [-h <ShareName>] [-m <Comment>] [-f <SeparatorFileName>] [-y <Datatype>] [-st <StartTime>] [-ut <UntilTime>] [-i <DefaultPriority>] [-o <Priority>] [<+|->shared] [<+|->direct] [<+|->hidden] [<+|->published] [<+|->rawonly] [<+|->queued] [<+|->enablebidi] [<+|->keepprintedjobs] [<+|->workoffline] [<+|->enabledevq] [<+|->docompletefirst]

Parameters

Parameter

Description

-g

Displays configuration information about a printer.

-t

Configures a printer.

-x

Renames a printer.

-S <ServerName>

Specifies the name of the remote computer that hosts the printer that you want to manage. If you do not specify a computer, the local computer is used.

-P <PrinterName>

Specifies the name of the printer that you want to manage. Required.

-z <NewPrinterName>

Specifies the new printer name. Requires the -x and -P parameters.

-u <UserName> -w <Password>

Specifies an account with permissions to connect to the computer that hosts the printer that you want to manage. All members of the target computer's local Administrators group 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.

-r <PortName>

Specifies the port where 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, use the port name that was specified when the port was added.

-l <Location>

Specifies the printer location, such as "Copy Room."

-h <ShareName>

Specifies the printer's share name.

-m <Comment>

Specifies the printer's comment string.

-f <SeparatorFileName>

Specifies a file that contains the text that appears on the separator page.

-y <DataType>

Specifies the data types that the printer can accept.

-st <StartTime>

Configures the printer for limited availability. Specifies the time of day 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:00 P.M., type 2300.

-ut <EndTime>

Configures the printer for limited availability. Specifies the time of day 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:00 P.M., type 2300.

-o <Priority>

Specifies a priority that the spooler uses to route print jobs into the print queue. 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 in 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 parameter 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 a user is able to send print jobs to the print queue if the 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 print jobs with a lower priority that have completed spooling before sending 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

  • The Prncnfg.vbs command is a Visual Basic script located in the %WINDIR%\System32\Printing_Admin_Scripts\<language> directory. To use this command, at a command prompt, type Cscript followed by the full path to the Prncnfg.vbs file, or change directories to the appropriate folder. For example:

    Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prncnfg.vbs
    
  • 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 with a print queue hosted by the remote computer named HRServer, type:

Cscript Prncnfg.vbs -g -S HRServer -P ColorPrinter_2 

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 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" 

Additional references

Command-Line Syntax Key

Print Command Reference