Prnport command in Windows
(Applies to Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012)
The prnport command in addition to displaying and changing the port configuration also helps create, delete and list standard TCP / IP printer ports,
Prnport command syntax
cscript prnport {-a | -d | -l | -g | -t | -?} [-r]
lpr}]
d}
-d}
Prnport command parameter
Parameters
Describe
-a
Create a standard TCP / IP printer port.
-d
Delete a standard TCP / IP printer port.
-l
List all standard TCP IP printer ports on the computer specified by the -s parameter.
-g
Displays the configuration of the standard TCP / IP printer port.
-t
Configure settings for standard TCP / IP printer ports.
-r
Specify the port to which the printer is connected.
-S
Specify the name of the remote computer that the printer store you want to manage.If you do not specify a remote computer, the local computer will be used by default.
-u -w
Specify the authorized account to connect to the printer storage computer you want to manage.All members in the local administrator group of the target computer have these rights, but the permissions can also be granted to other users.If you do not specify an account, you must log in to an account with these permissions so that the command can be executed.
lpr}
Specify the protocol to which the port will use, TCP raw or TCP lpr.If you use raw TCP, you can optionally specify the port number by using the -n parameter.The default port number is 9100.
-hour
Specify (by IP address) the printer you want to configure the port for.
-q
Specifies the queue name for a raw TCP port.
-n
Specify the port number for the raw TCP port.The default port number is 9100.
d}
Specify whether SNMP is enabled.Parameter e activates SNMP.The parameter d turns off SNMP.
-i
Specify the SNMP index, if SNMP is enabled.For more information, see Rfc 1759 at the Rfc editor website.
-y
Specify the community name of SNMP, if SNMP is enabled.
-d}
Specify whether the double spool (double spools, also called respooling) is enabled for TCP lpr port.Dual spool is necessary because TCP lpr must include the exact number of bytes in the control file sent to the printer, but the protocol cannot receive the count from the local print provider.So when a file is spooled into a TCP lpr queue, it is also spooled as a temporary file in the system32 directory.TCP lpr determines the size of the temporary file and sends this size to the server running LPD.The parameter e activates the double spool while parameter d disables the double spool.
/?
Show help at thecommand prompt.
Prnport command comment
The prnport command is a Visual Basic script located in the % WINdir% System32printing_Admin_Scripts directory . To use this command, at the command prompt, type cscript followed by the full path to the prnport file, or change the directory to the appropriate directory.For example:
cscript% WINdir% System32printing_Admin_Scriptsen-USprnport
If the information you provide contains spaces, use quotation marks for the text (for example, "computer Name").
Example prnport command
To display all standard TCP / IP print ports on the server named Server1, enter:
cscript prnport -l -s Server1
To delete the standard TCP / IP print port on the server named Server1 connected to the printer network in 10.2.3.4, enter:
cscript prnport -d -s Server1 -r IP_10.2.3.4
To add a standard TCP / IP print port on a server named Server1 connected to the printer network in 10.2.3.4 and use the raw TCP protocol on port 9100, enter:
cscript prnport -a -s Server1 -r IP_10.2.3.4 -h 10.2.3.4 -o raw -n 9100
To enable SNMP, specify the "public" community name and set the SNMP index to 1 on the printer network in 10.2.3.4 shared by the Server1 server:
cscript prnport -t -s Server1 -r IP_10.2.3.4 -me -y public -i 1 -n 9100
To add a standard TCP / IP print port on the local computer connected to the printer network in 10.2.3.4 and automatically receive device settings from the printer, enter:
cscript prnport -a -r IP_10.2.3.4 -h 10.2.3.4
See more:
- The print command in Windows
- The net print command in Windows
- Netcfg command in Windows
- Nbtstat command in Windows
You should read it
May be interested
- Instructions for using Command Promptdeep in windows is a command-line world that is obscure. in this article, we will show you how to solve errors and make your computer more secure.
- Rd command in Windowsthe rd command helps delete a directory
- Cmd command in Windowsthe cmd command starts a new version of the command interpreter, cmd.exe. if used without parameters, cmd will display copyright information and the version of the operating system.
- How to use the command history function in Command Promptcommand prompt is an extremely familiar command for anyone using windows operating system. besides, a lot of current software also supports the command line to perform actions on the command prompt window, instead of on the screen.
- The sfc command in Windows(applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012)
- Reg command copy in Windowsto copy an entry to the location specified on the local pc or the remote computer we will use the reg copy command. to learn more about how to use the reg copy command, you can track the syntax, explain the command parameters and the example tipsmake.com has compiled below.
- Fc command in Windowsthe fc command compares two files or a collection of files and displays the differences between them.
- The echo command in Windowsthe echo command displays the message or turns on / off the command repeat feature. if used without parameters, the echo command will display the current echo setting.
- Xcopy command in Windowsthe xcopy command is a command prompt command used to copy one or more files or folders from one location to another. with many options and the ability to copy entire directories, the xcopy command is similar to, but much more powerful, than the copy command.
- The cacls command in Windowsthe cacls command displays or modifies an arbitrary access control list (dacl) on the specified file. the command applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012.