WshNetwork.AddWindowsPrinterConnection

Posted: 08-30-2006, 09:00 AM
Hello

Does any body know why the (under Windows XP properly working) vbs-script

Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\servername\printername"

fails under Windows Vista with the following error message?:

"Windows Script Host"
Script: ...\scriptname.vbs
Line: 2
Char: 1
Error: The specified procedure could not be found
Code: 8007007F

Thanks for any support in advance.
Best regards


Robert Fischer
(University of Applied Sciences Nuremberg, Department Computer Scienes,
Windows Administration)

P.S.: I've written an error report to Microsoft


Reply With Quote

Responses to "WshNetwork.AddWindowsPrinterConnection"

John [MS]
Guest
Posts: n/a
 
Re: WshNetwork.AddWindowsPrinterConnection
Posted: 09-01-2006, 04:06 AM
What build are you running? Line 2 is WshNetwork.AddWindowsPrinterConnection
"\\servername\printername"
Can you browse to the share? Can u install the printer by going to that
share? Try disabling UAC

John
Microsoft Windows Beta Team


"Robert Fischer" <robert.fischer@informatik.fh-nuernberg.de> wrote in
message news:Ocf%23MpAzGHA.996@TK2MSFTNGP03.phx.gbl...
> Hello
>
> Does any body know why the (under Windows XP properly working) vbs-script
>
> Set WshNetwork = CreateObject("WScript.Network")
> WshNetwork.AddWindowsPrinterConnection "\\servername\printername"
>
> fails under Windows Vista with the following error message?:
>
> "Windows Script Host"
> Script: ...\scriptname.vbs
> Line: 2
> Char: 1
> Error: The specified procedure could not be found
> Code: 8007007F
>
> Thanks for any support in advance.
> Best regards
>
>
> Robert Fischer
> (University of Applied Sciences Nuremberg, Department Computer Scienes,
> Windows Administration)
>
> P.S.: I've written an error report to Microsoft
>
>
Reply With Quote
Robert Fischer
Guest
Posts: n/a
 
Re: WshNetwork.AddWindowsPrinterConnection
Posted: 09-01-2006, 09:47 AM
Hello John

This error occurs with BUILD 5536, 5472.5 and 5384.

Network-Browsing is disabled in our network for security reasons.
But running the command "net view \\servername" enumerates the printershare \\servername\printername properly.

Trying to install the printer by going to that share leads to the following error messages:
"The printer name is invalid"
"The printer cannot be found"
"Spooler Subsystem App stopped working and was closed"

Then I've tried to apply the following script after restarting the local "Print Spooler" service a lot of times:
rundll32 printui.dll,PrintUIEntry /in /c\\servername /n\\servername\printername /u /q
And suddenly the printer has been installed properly.

I've tried to reproduce the behaviour but I canīt find any rule:
Very often the Printer Spooler crashes and there is no way to connect to that network printer; but sometimes it works properly?!

Disabling UAC (HKLM\Software\Microsoft\Windows\CurrentVersion\Po licies\System\EnableLUA=0) causes the same problems.

These printer shares are part of our Windows Server 2003/Windows XP network and are doing their job for about 4 years without any problems (these shares are assigned via AD Group Policies)!
There are concurrent IPsec-based connections from my workstation to the server \\servername because this server also acts as a file server for the home directories; could this be a problem for Windows Vista?

Any ideas?

Best regards


Robert


"John [MS]" <a-johnr@microsoft.com> wrote in message news:ONCtTOXzGHA.3704@TK2MSFTNGP02.phx.gbl...
> What build are you running? Line 2 is WshNetwork.AddWindowsPrinterConnection
> "\\servername\printername"
> Can you browse to the share? Can u install the printer by going to that
> share? Try disabling UAC
>
> John
> Microsoft Windows Beta Team
>
>
> "Robert Fischer" <robert.fischer@informatik.fh-nuernberg.de> wrote in
> message news:Ocf%23MpAzGHA.996@TK2MSFTNGP03.phx.gbl...
>> Hello
>>
>> Does any body know why the (under Windows XP properly working) vbs-script
>>
>> Set WshNetwork = CreateObject("WScript.Network")
>> WshNetwork.AddWindowsPrinterConnection "\\servername\printername"
>>
>> fails under Windows Vista with the following error message?:
>>
>> "Windows Script Host"
>> Script: ...\scriptname.vbs
>> Line: 2
>> Char: 1
>> Error: The specified procedure could not be found
>> Code: 8007007F
>>
>> Thanks for any support in advance.
>> Best regards
>>
>>
>> Robert Fischer
>> (University of Applied Sciences Nuremberg, Department Computer Scienes,
>> Windows Administration)
>>
>> P.S.: I've written an error report to Microsoft
>>
>>
>
Reply With Quote
 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump