Adding a printer/port Commandline - Auto installing printers/portd

G

Guest

I am trying to install TCP/IP printers via command line on my Windows XP pro
using the following command I get this:

C:\WINDOWS\system32>cscript prnport.vbs -a -r IP_172.16.41.54
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Unable to create/update port IP_172.16.41.54 Error 0x80041008 Invalid
parameter

Anyone know what's going wrong and how I can fix it?
 
A

Alan Morris [MSFT]

requires a hostname parameter (or IP address)

-h
prnport -a -r IP_1.2.3.4 -h 1.2.3.4


the r parameter is only the port name and that does not have to be the same
as the -h parameter

If the network card of the printer is in tcpmon.ini then the wmi process
will consume your CPU cycles (on XP) due to a bug in cimwin32.dll

Pass in the -o parameter to work around this

Arguments:
-a - add a port
-d - delete the specified port
-g - get configuration for a TCP port
-h - IP address of the device
-i - SNMP index, if SNMP is enabled
-l - list all TCP ports
-m - SNMP type. [e] enable, [d] disable
-n - port number, applies to TCP RAW ports
-o - port type, raw or lpr
-q - queue name, applies to TCP LPR ports
-r - port name
-s - server name
-t - set configuration for a TCP port
-u - user name
-w - password
-y - community name, if SNMP is enabled
-2 - double spool, applies to TCP LPR ports. [e] enable, [d] disable
-? - display command usage


--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

I then added the IP address and it hangs. Does the PC and the TCP/IP printer
have to be in the same subnet?

That doesn't make sense because the wizzard will do it but the command line
will not.

c:\ cscript prnport.vbs -a -r IP_PRINTER -h 172.16.41.54 <-This command
hangs the process
I am 172.17.96.108



Alan Morris said:
requires a hostname parameter (or IP address)

-h
prnport -a -r IP_1.2.3.4 -h 1.2.3.4


the r parameter is only the port name and that does not have to be the same
as the -h parameter

If the network card of the printer is in tcpmon.ini then the wmi process
will consume your CPU cycles (on XP) due to a bug in cimwin32.dll

Pass in the -o parameter to work around this

Arguments:
-a - add a port
-d - delete the specified port
-g - get configuration for a TCP port
-h - IP address of the device
-i - SNMP index, if SNMP is enabled
-l - list all TCP ports
-m - SNMP type. [e] enable, [d] disable
-n - port number, applies to TCP RAW ports
-o - port type, raw or lpr
-q - queue name, applies to TCP LPR ports
-r - port name
-s - server name
-t - set configuration for a TCP port
-u - user name
-w - password
-y - community name, if SNMP is enabled
-2 - double spool, applies to TCP LPR ports. [e] enable, [d] disable
-? - display command usage


--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.

Fiji Smithy said:
I am trying to install TCP/IP printers via command line on my Windows XP
pro
using the following command I get this:

C:\WINDOWS\system32>cscript prnport.vbs -a -r IP_172.16.41.54
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Unable to create/update port IP_172.16.41.54 Error 0x80041008 Invalid
parameter

Anyone know what's going wrong and how I can fix it?
 
A

Alan Morris [MSFT]

As I stated in my previous post, there is a bug in the WMI provider. This
has been fixed in Server but no customer has reported the problem to MS on
Windows XP. Feel free to report it, since it's the only why it will be
fixed.

What printer are you targeting. HP and Lexmark use -o raw. Other
manufactures have different settings. You need to read the documentation
for the network card on the printer.

If the network card of the printer is in tcpmon.ini then the wmi process
will consume your CPU cycles (on XP) due to a bug in cimwin32.dll

Pass in the -o parameter to work around this


--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.

Fiji Smithy said:
I then added the IP address and it hangs. Does the PC and the TCP/IP
printer
have to be in the same subnet?

That doesn't make sense because the wizzard will do it but the command
line
will not.

c:\ cscript prnport.vbs -a -r IP_PRINTER -h 172.16.41.54 <-This command
hangs the process
I am 172.17.96.108



Alan Morris said:
requires a hostname parameter (or IP address)

-h
prnport -a -r IP_1.2.3.4 -h 1.2.3.4


the r parameter is only the port name and that does not have to be the
same
as the -h parameter

If the network card of the printer is in tcpmon.ini then the wmi process
will consume your CPU cycles (on XP) due to a bug in cimwin32.dll

Pass in the -o parameter to work around this

Arguments:
-a - add a port
-d - delete the specified port
-g - get configuration for a TCP port
-h - IP address of the device
-i - SNMP index, if SNMP is enabled
-l - list all TCP ports
-m - SNMP type. [e] enable, [d] disable
-n - port number, applies to TCP RAW ports
-o - port type, raw or lpr
-q - queue name, applies to TCP LPR ports
-r - port name
-s - server name
-t - set configuration for a TCP port
-u - user name
-w - password
-y - community name, if SNMP is enabled
-2 - double spool, applies to TCP LPR ports. [e] enable, [d] disable
-? - display command usage


--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no
rights.

Fiji Smithy said:
I am trying to install TCP/IP printers via command line on my Windows XP
pro
using the following command I get this:

C:\WINDOWS\system32>cscript prnport.vbs -a -r IP_172.16.41.54
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Unable to create/update port IP_172.16.41.54 Error 0x80041008 Invalid
parameter

Anyone know what's going wrong and how I can fix it?
 
G

Guest

Perfect so I can add the port no problem but now I'm having problems adding
the pritners with an .INF file. I have downloaded the drivers for the printer
and stored them in C:\2135ps2k\

I am executing the command:
rundll32 printui.dll,PrintUIEntry /if /b "Colour-EDM" /f
"C:2135ps2k\XP2135PS.INF" /r "IP_172.16.42.71" /m "Xerox Phaser 2135 PS" /z
/u

When I hit enter I get a message that says Operation could not be complete.
Any ideas why?

Alan Morris said:
As I stated in my previous post, there is a bug in the WMI provider. This
has been fixed in Server but no customer has reported the problem to MS on
Windows XP. Feel free to report it, since it's the only why it will be
fixed.

What printer are you targeting. HP and Lexmark use -o raw. Other
manufactures have different settings. You need to read the documentation
for the network card on the printer.

If the network card of the printer is in tcpmon.ini then the wmi process
will consume your CPU cycles (on XP) due to a bug in cimwin32.dll

Pass in the -o parameter to work around this


--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.

Fiji Smithy said:
I then added the IP address and it hangs. Does the PC and the TCP/IP
printer
have to be in the same subnet?

That doesn't make sense because the wizzard will do it but the command
line
will not.

c:\ cscript prnport.vbs -a -r IP_PRINTER -h 172.16.41.54 <-This command
hangs the process
I am 172.17.96.108



Alan Morris said:
requires a hostname parameter (or IP address)

-h
prnport -a -r IP_1.2.3.4 -h 1.2.3.4


the r parameter is only the port name and that does not have to be the
same
as the -h parameter

If the network card of the printer is in tcpmon.ini then the wmi process
will consume your CPU cycles (on XP) due to a bug in cimwin32.dll

Pass in the -o parameter to work around this

Arguments:
-a - add a port
-d - delete the specified port
-g - get configuration for a TCP port
-h - IP address of the device
-i - SNMP index, if SNMP is enabled
-l - list all TCP ports
-m - SNMP type. [e] enable, [d] disable
-n - port number, applies to TCP RAW ports
-o - port type, raw or lpr
-q - queue name, applies to TCP LPR ports
-r - port name
-s - server name
-t - set configuration for a TCP port
-u - user name
-w - password
-y - community name, if SNMP is enabled
-2 - double spool, applies to TCP LPR ports. [e] enable, [d] disable
-? - display command usage


--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no
rights.

I am trying to install TCP/IP printers via command line on my Windows XP
pro
using the following command I get this:

C:\WINDOWS\system32>cscript prnport.vbs -a -r IP_172.16.41.54
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Unable to create/update port IP_172.16.41.54 Error 0x80041008 Invalid
parameter

Anyone know what's going wrong and how I can fix it?
 
A

Alan Morris [MSFT]

try
/f C:\2135ps2k\XP2135PS.INF

you can also use prndrvr.vbs and prnmngr.vbs

prndrvr -a -m "Xerox Phaser 2135 PS" -v 3 -e "Windows NT x86" -i
C:\2135ps2k\XP2135PS.INF -h C:\2135ps2k
prnmngr -a -m "Xerox Phaser 2135 PS" -r IP_172.16.42.71 -p "Colour-EDM"

--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.

Fiji Smithy said:
Perfect so I can add the port no problem but now I'm having problems
adding
the pritners with an .INF file. I have downloaded the drivers for the
printer
and stored them in C:\2135ps2k\

I am executing the command:
rundll32 printui.dll,PrintUIEntry /if /b "Colour-EDM" /f
"C:2135ps2k\XP2135PS.INF" /r "IP_172.16.42.71" /m "Xerox Phaser 2135 PS"
/z
/u

When I hit enter I get a message that says Operation could not be
complete.
Any ideas why?

Alan Morris said:
As I stated in my previous post, there is a bug in the WMI provider.
This
has been fixed in Server but no customer has reported the problem to MS
on
Windows XP. Feel free to report it, since it's the only why it will be
fixed.

What printer are you targeting. HP and Lexmark use -o raw. Other
manufactures have different settings. You need to read the documentation
for the network card on the printer.

If the network card of the printer is in tcpmon.ini then the wmi
process
will consume your CPU cycles (on XP) due to a bug in cimwin32.dll

Pass in the -o parameter to work around this


--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no
rights.

Fiji Smithy said:
I then added the IP address and it hangs. Does the PC and the TCP/IP
printer
have to be in the same subnet?

That doesn't make sense because the wizzard will do it but the command
line
will not.

c:\ cscript prnport.vbs -a -r IP_PRINTER -h 172.16.41.54 <-This command
hangs the process
I am 172.17.96.108



:

requires a hostname parameter (or IP address)

-h
prnport -a -r IP_1.2.3.4 -h 1.2.3.4


the r parameter is only the port name and that does not have to be the
same
as the -h parameter

If the network card of the printer is in tcpmon.ini then the wmi
process
will consume your CPU cycles (on XP) due to a bug in cimwin32.dll

Pass in the -o parameter to work around this

Arguments:
-a - add a port
-d - delete the specified port
-g - get configuration for a TCP port
-h - IP address of the device
-i - SNMP index, if SNMP is enabled
-l - list all TCP ports
-m - SNMP type. [e] enable, [d] disable
-n - port number, applies to TCP RAW ports
-o - port type, raw or lpr
-q - queue name, applies to TCP LPR ports
-r - port name
-s - server name
-t - set configuration for a TCP port
-u - user name
-w - password
-y - community name, if SNMP is enabled
-2 - double spool, applies to TCP LPR ports. [e] enable, [d]
disable
-? - display command usage


--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no
rights.

I am trying to install TCP/IP printers via command line on my Windows
XP
pro
using the following command I get this:

C:\WINDOWS\system32>cscript prnport.vbs -a -r IP_172.16.41.54
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Unable to create/update port IP_172.16.41.54 Error 0x80041008
Invalid
parameter

Anyone know what's going wrong and how I can fix it?
 
Joined
May 25, 2010
Messages
1
Reaction score
0
Prnport.vbs

I was able to follow the instructions for creating a TCPIP port via Prnport.vbs but it didn't make the port active. There was an existing TCPIP port and it kept that one active. Is there a switch to make the new port active? Thanks
 
Joined
Sep 11, 2017
Messages
1
Reaction score
0
Re: Adding a printer/port Commandline - Auto installing printers/p

try
/f C:\2135ps2k\XP2135PS.INF

you can also use prndrvr.vbs and prnmngr.vbs

prndrvr -a -m "Xerox Phaser 2135 PS" -v 3 -e "Windows NT x86" -i
C:\2135ps2k\XP2135PS.INF -h C:\2135ps2k
prnmngr -a -m "Xerox Phaser 2135 PS" -r IP_172.16.42.71 -p "Colour-EDM"

--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.

"Fiji Smithy" <[email protected]> wrote in message
news:[email protected]...
> Perfect so I can add the port no problem but now I'm having problems
> adding
> the pritners with an .INF file. I have downloaded the drivers for the
> printer
> and stored them in C:\2135ps2k\
>
> I am executing the command:
> rundll32 printui.dll,PrintUIEntry /if /b "Colour-EDM" /f
> "C:2135ps2k\XP2135PS.INF" /r "IP_172.16.42.71" /m "Xerox Phaser 2135 PS"
> /z
> /u
>
> When I hit enter I get a message that says Operation could not be
> complete.
> Any ideas why?
>
> "Alan Morris [MSFT]" wrote:
>
>> As I stated in my previous post, there is a bug in the WMI provider.

>> This
>> has been fixed in Server but no customer has reported the problem to MS
>> on
>> Windows XP. Feel free to report it, since it's the only why it will be
>> fixed.
>>
>> What printer are you targeting. HP and Lexmark use -o raw. Other
>> manufactures have different settings. You need to read the documentation
>> for the network card on the printer.
>>
>>
>> > If the network card of the printer is in tcpmon.ini then the wmi
>> > process
>> > will consume your CPU cycles (on XP) due to a bug in cimwin32.dll
>> >
>> > Pass in the -o parameter to work around this
>> >
>>
>>
>> --
>> Alan Morris
>> Windows Printing Team
>> Search the Microsoft Knowledge Base here:
>> http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto
>>
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Fiji Smithy" <[email protected]> wrote in message
>> news:[email protected]...
>> >I then added the IP address and it hangs. Does the PC and the TCP/IP
>> >printer
>> > have to be in the same subnet?
>> >
>> > That doesn't make sense because the wizzard will do it but the command
>> > line
>> > will not.
>> >
>> > c:\ cscript prnport.vbs -a -r IP_PRINTER -h 172.16.41.54 <-This command
>> > hangs the process
>> > I am 172.17.96.108
>> >
>> >
>> >
>> > "Alan Morris [MSFT]" wrote:
>> >
>> >> requires a hostname parameter (or IP address)
>> >>
>> >> -h
>> >> prnport -a -r IP_1.2.3.4 -h 1.2.3.4
>> >>
>> >>
>> >> the r parameter is only the port name and that does not have to be the
>> >> same
>> >> as the -h parameter
>> >>
>> >> If the network card of the printer is in tcpmon.ini then the wmi
>> >> process
>> >> will consume your CPU cycles (on XP) due to a bug in cimwin32.dll
>> >>
>> >> Pass in the -o parameter to work around this
>> >>
>> >> Arguments:
>> >> -a - add a port
>> >> -d - delete the specified port
>> >> -g - get configuration for a TCP port
>> >> -h - IP address of the device
>> >> -i - SNMP index, if SNMP is enabled
>> >> -l - list all TCP ports
>> >> -m - SNMP type. [e] enable, [d] disable
>> >> -n - port number, applies to TCP RAW ports
>> >> -o - port type, raw or lpr
>> >> -q - queue name, applies to TCP LPR ports
>> >> -r - port name
>> >> -s - server name
>> >> -t - set configuration for a TCP port
>> >> -u - user name
>> >> -w - password
>> >> -y - community name, if SNMP is enabled
>> >> -2 - double spool, applies to TCP LPR ports. [e] enable, [d]
>> >> disable
>> >> -? - display command usage
>> >>
>> >>
>> >> --
>> >> Alan Morris
>> >> Windows Printing Team
>> >> Search the Microsoft Knowledge Base here:
>> >> http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto
>> >>
>> >> This posting is provided "AS IS" with no warranties, and confers no
>> >> rights.
>> >>
>> >> "Fiji Smithy" <[email protected]> wrote in message
>> >> news:[email protected]...
>> >> >I am trying to install TCP/IP printers via command line on my Windows
>> >> >XP
>> >> >pro
>> >> > using the following command I get this:
>> >> >
>> >> > C:\WINDOWS\system32>cscript prnport.vbs -a -r IP_172.16.41.54
>> >> > Microsoft (R) Windows Script Host Version 5.6
>> >> > Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
>> >> >
>> >> > Unable to create/update port IP_172.16.41.54 Error 0x80041008
>> >> > Invalid
>> >> > parameter
>> >> >
>> >> > Anyone know what's going wrong and how I can fix it?
>> >>
>> >>
>> >>
>>
>>
>>


Do this: Cscript Prnport.vbs -a -r IP_1.2.3.4 -h 1.2.3.4 -o lpr -q LPR -y public

Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.
Created/updated port IP_1.2.3.4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top