WshNetwork.AddWindowsPrinterConnection

  • Thread starter Thread starter Robert Fischer
  • Start date Start date
R

Robert Fischer

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
 
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
 
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\Policies\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
 
Back
Top