System command

prncnfg command

Configures or displays configuration information about a printer. This guide lists the documented syntax and parameters for prncnfg; check Microsoft Learn for version, role and execution-context requirements.

Availability: Microsoft Learn command reference spanning Windows client and Windows Server releases; some entries are legacy, role-specific, optional-feature or interactive subcommands.中文

Documented 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]

The linked Microsoft Learn article is the upstream authority. Availability may depend on Windows release, role, optional feature or interactive tool context.

Examples

Example from the linked Microsoft Learn article. Check its paths, targets and availability before adapting it.

cscript %WINDIR%\System32\printing_Admin_Scripts\en-US\prncnfg -g -P "Office Printer"

Parameters, options and clauses

Option / clauseDescription
-gDisplay printer configuration.
-tConfigure the specified printer.
-xRename the printer; requires -P and -z.
-S <Servername>Select the computer hosting the printer; defaults to the local computer.
-P <Printername>Select the printer to manage; required.
-z <newprintername>Set the new printer name when using -x.
-u <Username> -w <password>Supply credentials with permission to manage the target printer.
-r <portname>Set the printer port name.
-l <location>, -h <sharename>, -m <comment>Set the location, share name or comment.
-f <separatorfilename>, -y <datatype>Set the separator page file or accepted data type.
-st <starttime>, -ut <untiltime>Set printer availability times using 24-hour time.
-i <defaultpriority>, -o <priority>Set the default job priority or printer queue priority.
+/-shared, direct, hidden, published, rawonly, queuedEnable or disable the corresponding printer queue property with + or -.
+/-enablebidi, keepprintedjobs, workoffline, enabledevq, docompletefirstEnable or disable bidirectional status, job retention, offline queueing, device mismatch queueing or complete-first processing.
-?Display command help or the supported command-line usage.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory