Table of Contents
Prnport Command in Windows is easier to understand when the core ideas are paired with practical examples. The sections below explain the topic clearly, highlight useful steps, and point out details that can prevent common errors.
(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 instance,:
cscript% WINdir% System32printing_Admin_Scriptsen-USprnport
If the information you provide contains spaces, use quotation marks for the text (For instance,, "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
- The print command in Windows
- The net print command in Windows
- Netcfg command in Windows
- Nbtstat command in Windows
FAQ
What is Prnport Command in Windows?
Prnport Command in Windows refers to the core ideas, tools, or processes explained in this guide. Understanding the basics makes the more advanced details easier to apply.
Why is Prnport Command in Windows important?
A clear understanding of Prnport Command in Windows helps you make informed decisions, avoid common mistakes, and use the relevant tools or techniques more effectively.
How should beginners approach Prnport Command in Windows?
Start with the fundamental concepts, follow the examples step by step, and test each change in a safe environment before applying it to important systems or data.
Reader Comments 0
Sign in with email or Google to join the discussion.