Example from the linked Microsoft Learn article. Check its paths, targets and availability before adapting it.
cscript prnmngr -a -p colorprinter_2 -m "color printer Driver1" -r lpt1:Adds, deletes, and lists printers or printer connections, in addition to setting and displaying the default printer. This guide lists the documented syntax and parameters for prnmngr; check Microsoft Learn for version, role and execution-context requirements.
cscript prnmngr {-a | -d | -x | -g | -t | -l | -?}[c] [-s <Servername>] [-p <Printername>] [-m <printermodel>] [-r <portname>] [-u <Username>] [-w <password>]The linked Microsoft Learn article is the upstream authority. Availability may depend on Windows release, role, optional feature or interactive tool context.
Example from the linked Microsoft Learn article. Check its paths, targets and availability before adapting it.
cscript prnmngr -a -p colorprinter_2 -m "color printer Driver1" -r lpt1:Example from the linked Microsoft Learn article. Check its paths, targets and availability before adapting it.
cscript prnmngr -d -s HRServer -p colorprinter_2| Option / clause | Description |
|---|---|
-a / -d | Add a local printer connection or delete a printer connection. |
-x | Delete all printers on the selected server; if omitted, the local computer is used. |
-g / -t | Display the default printer or set the default printer selected by -p. |
-l | List installed printers on the selected server or local computer. |
c | Apply a supported operation to printer connections; Microsoft documents it with -a and -x. |
-s <Servername> | Manage printers on a remote computer; omit to use the local computer. |
-p <Printername> | Select the printer to manage. |
-m <printermodel> | Specify the printer driver model when adding a printer. |
-r <portname> | Select the printer port, such as LPT1:, COM1: or a configured TCP/IP port. |
-u <Username> -w <password> | Provide credentials authorized to manage the target computer. Avoid exposing passwords in shell history. |
-? | Display command help. |
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.