Information Technology Reference
In-Depth Information
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\
Standard TCP/IP Port\Ports\<
YourNewPrinterPortName
>]
Create the following values under the new subkey:
"IPAddress"="<
YourPortIPAddress
>"
"Protocol"=dword:
<PortValue>
"SNMP Community"="
<YourSNMPCommunityName>
"
"SNMP Enabled"=dword:
<EnabledFlag>
"SNMP Index"=dword:
<YourSNMPIndex>
"Queue"="
<QueueName>
"
"PortNumber"=dword:
<YourPortNumber>
"Double Spool"=dword:<
DoubleSpoolEnabledFlag
>
Protocol
may take a value of either
1
(RAW port) or
2
(LPR port).
SNMP Enabled
may take
a value of either
0
(disabled) or
1
(enabled).
SNMP Index
is required only if this port is SNMP-
enabled.
Double Spool
may take a value of
0
(disabled) or
1
(enabled).
For example, to create a TCP/IP RAW port named
IP_192.168.2.10
with an IP address of
192.168.2.10, enter the following information into the Registry. The port number will be the
default value of
9100
(
0000238c
in hexadecimal notation), and SNMP will be disabled on this port.
Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\...
...Print\Monitors\Standard TCP/IP Port\Ports\IP_192.168.2.10]
"IPAddress"="192.168.2.10"
"PortNumber"=dword:0000238c
"Protocol"=dword:00000001
"SNMP Community"="public"
"SNMP Enabled"=dword:00000000
"SNMP Index"=dword:00000001
To configure an existing port, modify the existing value/data pairs in the port's subkey as
necessary.
Using VBScript
You can create a TCP/IP port or modify an existing one by executing
prnport.vbs
, located in
the
%systemroot%\system32
directory. Use the following syntax:
> cscript prnport.vbs {-a | -t} -r
<PortName>
[-s
<RemoteComputer>
] -h
<IPAddress>
[-u <
UserName
> -w <
Password
>] [-o {raw -n <
PortNumber
>| lpr}] [-q <
QueueName
>]
[-m{e | d}] [-I
<IndexName>
] [-y
<CommunityName>
] [-2{e | d}] [-t]
Here is a description of the parameters:
-a | -t
: Required parameter that tells the script that you intend to create or modify a standard
TCP/IP printer port. Use
-a
to create a new port; use
-t
to configure an existing one.
-r
PortName
: Required parameter that specifies the port to which the printer is connected.