Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Specified port is unknown 80070704

Reply
 
Old 09-08-2008   #1 (permalink)
Luke Morehead


 
 

Specified port is unknown 80070704

Some Vista clients intermittently receive the following when their
printer-mapping logon script runs:

Windows Script Host
Line: 37
Char: 1
Error: The specified port is unknown.
Code: 80070704
Source: (null)

I've pasted an excerpt from the script below. Line 37 is the first one
beginning with "ObjNetwork.AddWindowsPrinterConnection". Note that if I
delete the printers and run the script manually, the printers are added
correctly. Thanks in advance.
(Luke)

Option Explicit

Dim objNetwork
Dim strDomain
Dim strUser
Dim Network

'THIS CODE GRABS THE LOGGED-ON USER - THE LOOP PART MAKES IT WORK W/ LEGACY
CLIENTS

Set ObjNetwork=WScript.CreateObject("WScript.Network")
If LCase(ObjNetwork.ComputerName) <> "gwctx1" Then

Set Network = CreateObject("Wscript.Network")
do while strUser=""
strUser=Network.UserName
wscript.sleep 100
loop
end if

strDomain="Gardnerwhite"

Const PrinterShare1 = "\\sv-directory1\Brother-B&W"
Const PrinterShare2 = "\\sv-directory1\Brother-Color"
Const PrinterShare3 = "\\sv-directory1\Brother-High Res"


'***Everyone gets these printers***
ObjNetwork.AddWindowsPrinterConnection PrinterShare1
ObjNetwork.AddWindowsPrinterConnection PrinterShare2
ObjNetwork.AddWindowsPrinterConnection PrinterShare3

My System SpecsSystem Spec
Old 09-08-2008   #2 (permalink)
Al Dunbar


 
 

Re: Specified port is unknown 80070704


"Luke Morehead" <LukeMorehead@xxxxxx> wrote in message
news:7CA19230-DFD9-42D1-8896-4E9579E124BD@xxxxxx
Quote:

> Some Vista clients intermittently receive the following when their
> printer-mapping logon script runs:
>
> Windows Script Host
> Line: 37
> Char: 1
> Error: The specified port is unknown.
> Code: 80070704
> Source: (null)
>
> I've pasted an excerpt from the script below. Line 37 is the first one
> beginning with "ObjNetwork.AddWindowsPrinterConnection". Note that if I
> delete the printers and run the script manually, the printers are added
> correctly. Thanks in advance.
> (Luke)
What happens if you delete the printers then logoff/logon so the logon
script runs again but *not* manually?

I would expect an attempt to add a printer connection might fail if that
connection already exists, although the error message seems a bit off. You
could just try doing corresponding "ObjNetwork.AddWindowsPrinterConnection"
calls for those printers already connected. Or just test for the connection
and avoid adding if it is already there.


/Al
Quote:

>
> Option Explicit
>
> Dim objNetwork
> Dim strDomain
> Dim strUser
> Dim Network
>
> 'THIS CODE GRABS THE LOGGED-ON USER - THE LOOP PART MAKES IT WORK W/
> LEGACY
> CLIENTS
>
> Set ObjNetwork=WScript.CreateObject("WScript.Network")
> If LCase(ObjNetwork.ComputerName) <> "gwctx1" Then
>
> Set Network = CreateObject("Wscript.Network")
> do while strUser=""
> strUser=Network.UserName
> wscript.sleep 100
> loop
> end if
>
> strDomain="Gardnerwhite"
>
> Const PrinterShare1 = "\\sv-directory1\Brother-B&W"
> Const PrinterShare2 = "\\sv-directory1\Brother-Color"
> Const PrinterShare3 = "\\sv-directory1\Brother-High Res"
>
>
> '***Everyone gets these printers***
> ObjNetwork.AddWindowsPrinterConnection PrinterShare1
> ObjNetwork.AddWindowsPrinterConnection PrinterShare2
> ObjNetwork.AddWindowsPrinterConnection PrinterShare3

My System SpecsSystem Spec
Old 09-12-2008   #3 (permalink)
Luke Morehead


 
 

Re: Specified port is unknown 80070704

I deleted the printers, then logged off and back on and received the same
error message. None of the three printers were added by the script. I then
ran the script manually and got the same error; again no printers were added.

I browsed to the printer on the network via Windows Explorer, right-clicked
on one of the printers and selected "Connect" from the context menu. I got
the error, "Windows cannot connect to the printer. The specified port is
unknown." I tried using the "Add Printer" wizard to add a printer from
Active Directory; same error. Does it seem that this thread now belongs in
a Vista group?

"Al Dunbar" wrote:
Quote:

> What happens if you delete the printers then logoff/logon so the logon
> script runs again but *not* manually?
>
> I would expect an attempt to add a printer connection might fail if that
> connection already exists, although the error message seems a bit off. You
> could just try doing corresponding "ObjNetwork.AddWindowsPrinterConnection"
> calls for those printers already connected. Or just test for the connection
> and avoid adding if it is already there.
>
>
> /Al
>
> "Luke Morehead" <LukeMorehead@xxxxxx> wrote in message
> news:7CA19230-DFD9-42D1-8896-4E9579E124BD@xxxxxx
Quote:

> > Some Vista clients intermittently receive the following when their
> > printer-mapping logon script runs:
> >
> > Windows Script Host
> > Line: 37
> > Char: 1
> > Error: The specified port is unknown.
> > Code: 80070704
> > Source: (null)
> >
> > I've pasted an excerpt from the script below. Line 37 is the first one
> > beginning with "ObjNetwork.AddWindowsPrinterConnection". Note that if I
> > delete the printers and run the script manually, the printers are added
> > correctly. Thanks in advance.
> > (Luke)
> >
> > Option Explicit
> >
> > Dim objNetwork
> > Dim strDomain
> > Dim strUser
> > Dim Network
> >
> > 'THIS CODE GRABS THE LOGGED-ON USER - THE LOOP PART MAKES IT WORK W/
> > LEGACY
> > CLIENTS
> >
> > Set ObjNetwork=WScript.CreateObject("WScript.Network")
> > If LCase(ObjNetwork.ComputerName) <> "gwctx1" Then
> >
> > Set Network = CreateObject("Wscript.Network")
> > do while strUser=""
> > strUser=Network.UserName
> > wscript.sleep 100
> > loop
> > end if
> >
> > strDomain="Gardnerwhite"
> >
> > Const PrinterShare1 = "\\sv-directory1\Brother-B&W"
> > Const PrinterShare2 = "\\sv-directory1\Brother-Color"
> > Const PrinterShare3 = "\\sv-directory1\Brother-High Res"
> >
> >
> > '***Everyone gets these printers***
> > ObjNetwork.AddWindowsPrinterConnection PrinterShare1
> > ObjNetwork.AddWindowsPrinterConnection PrinterShare2
> > ObjNetwork.AddWindowsPrinterConnection PrinterShare3
>
>
>
My System SpecsSystem Spec
Old 09-12-2008   #4 (permalink)
Al Dunbar


 
 

Re: Specified port is unknown 80070704


"Luke Morehead" <LukeMorehead@xxxxxx> wrote in message
news:10A1E2D4-916E-4D6E-9A98-53018E2CAA4B@xxxxxx
Quote:

>I deleted the printers, then logged off and back on and received the same
> error message. None of the three printers were added by the script. I
> then
> ran the script manually and got the same error; again no printers were
> added.
>
> I browsed to the printer on the network via Windows Explorer,
> right-clicked
> on one of the printers and selected "Connect" from the context menu. I
> got
> the error, "Windows cannot connect to the printer. The specified port is
> unknown." I tried using the "Add Printer" wizard to add a printer from
> Active Directory; same error. Does it seem that this thread now belongs
> in
> a Vista group?
Possibly, but for sure it is not a scripting issue... ;-)

But it could be a server issue or a security issue.

/Al
Quote:

> "Al Dunbar" wrote:
>
Quote:

>> What happens if you delete the printers then logoff/logon so the logon
>> script runs again but *not* manually?
>>
>> I would expect an attempt to add a printer connection might fail if that
>> connection already exists, although the error message seems a bit off.
>> You
>> could just try doing corresponding
>> "ObjNetwork.AddWindowsPrinterConnection"
>> calls for those printers already connected. Or just test for the
>> connection
>> and avoid adding if it is already there.
>>
>>
>> /Al
>>
>> "Luke Morehead" <LukeMorehead@xxxxxx> wrote in message
>> news:7CA19230-DFD9-42D1-8896-4E9579E124BD@xxxxxx
Quote:

>> > Some Vista clients intermittently receive the following when their
>> > printer-mapping logon script runs:
>> >
>> > Windows Script Host
>> > Line: 37
>> > Char: 1
>> > Error: The specified port is unknown.
>> > Code: 80070704
>> > Source: (null)
>> >
>> > I've pasted an excerpt from the script below. Line 37 is the first one
>> > beginning with "ObjNetwork.AddWindowsPrinterConnection". Note that if
>> > I
>> > delete the printers and run the script manually, the printers are added
>> > correctly. Thanks in advance.
>> > (Luke)
>> >
>> > Option Explicit
>> >
>> > Dim objNetwork
>> > Dim strDomain
>> > Dim strUser
>> > Dim Network
>> >
>> > 'THIS CODE GRABS THE LOGGED-ON USER - THE LOOP PART MAKES IT WORK W/
>> > LEGACY
>> > CLIENTS
>> >
>> > Set ObjNetwork=WScript.CreateObject("WScript.Network")
>> > If LCase(ObjNetwork.ComputerName) <> "gwctx1" Then
>> >
>> > Set Network = CreateObject("Wscript.Network")
>> > do while strUser=""
>> > strUser=Network.UserName
>> > wscript.sleep 100
>> > loop
>> > end if
>> >
>> > strDomain="Gardnerwhite"
>> >
>> > Const PrinterShare1 = "\\sv-directory1\Brother-B&W"
>> > Const PrinterShare2 = "\\sv-directory1\Brother-Color"
>> > Const PrinterShare3 = "\\sv-directory1\Brother-High Res"
>> >
>> >
>> > '***Everyone gets these printers***
>> > ObjNetwork.AddWindowsPrinterConnection PrinterShare1
>> > ObjNetwork.AddWindowsPrinterConnection PrinterShare2
>> > ObjNetwork.AddWindowsPrinterConnection PrinterShare3
>>
>>
>>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Unknown device - creative game port Vista General
Does Microsoft have an alternate port to port 25 for sending email Vista mail
a Unknown Serial Port Vista hardware & devices
The port is unknown Vista print fax & scan
USB hard drive won't work on a USB 2 port but will on a USB 1.1 port.Why? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46