PRNCNFG.vbs

Configure a printer (set properties, rename).

Display configuration information about a printer.
prncnfg.vbs is a VB Script located in the %WINDIR%\System32\Printing_Admin_Scripts\lang directory.

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

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]

Change the name of a printer:

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

Key

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

   ?         Help

Prncnfg.vbs is not on the Windows PATH but will be found at:
%Windir%\System32\Printing_Admin_Scripts\locale\prnmngr.vbs

Examples

   Set _scripts=cscript %Windir%\System32\Printing_Admin_Scripts\en-US

   :: Rename printer
   %_scripts%\prncnfg.vbs -x -p OldPrinter45 -z NewPrinter64

“Without books the development of civilization would have been impossible. They are the engines of change, windows on the world, ''Lighthouses'' as the poet said ''erected in the sea of time'.' They are companions, teachers, magicians, bankers of the treasures of the mind, Books are humanity in print” ~ Arthur Schopenhauer

Related commands

PRINT - Print a text file.
NET VIEW - to view a list of printers.
NET PRINT - View and Delete print jobs.
PRNDRVR - Add, delete or list printer drivers.
PRNJOBS - Pause, resume, cancel, or list print jobs.
PRNMNGR - Add, delete, or list printers / connections, set the default printer.
PRNPORT - Manage TCP/IP printer ports, change port configuration.
PRNQCTL - Manage printer queues, print a test page.
RUNDLL32 - Install/Remove Printers (plus advanced options).
WMIC PRINTER - Set printing options through WMI.
Q246868 - TCP/IP Printing options in the Windows Standard Port Monitor.
Add printer - .AddPrinterConnection
Add Network printer - .AddWindowsPrinterConnection
List printers - .EnumPrinterConnections
Set default printer - .SetDefaultPrinter
Equivalent bash command (Linux): lpc - Line printer control program.


 
Copyright © 1999-2024 SS64.com
Some rights reserved