Link to home
Start Free TrialLog in
Avatar of LeighWardle
LeighWardleFlag for Australia

asked on

Vbscript error message "The printer driver is unknown" code: 80070705

Hi Experts:

We are migrating from a Server running Windows SBS 2003 (name:Server) to a Server running Windows Server 2008 (name:Server2008).

Our Workstation/Clients are running Windows XP SP3.

Our Workstation/Client login script calls vbscript that has calls to AddWindowsPrinterConnection.

We are trying to revamp the vbscript AddWindowsPrinterConnection to reference printers on Server2008.

For one printer, this works:
      .AddWindowsPrinterConnection "\\server2008\Bing"

But for another printer,

      .AddWindowsPrinterConnection "\\server2008\Kylie"

      gives the error message "The printer driver is unknown"  code: 80070705
      
The driver that is being used for this printer on SBS 2003 is "Kyocera FS-2000D (KPDL)", so we tried this:

      .AddWindowsPrinterConnection "\\server2008\Kylie", "Kyocera FS-2000D (KPDL)"

      but it also gives the error message "The printer driver is unknown"  code: 80070705

The driver that is being used for this printer on Server 2008 is "Kyocera FS-2020D KX", so we tried this:
      
      .AddWindowsPrinterConnection "\\server2008\Kylie", "Kyocera FS-2020D KX"

      but it also gives the same error message.
      
I am testing the vbscript logged in as administrator.

Regards,
Leigh
Avatar of holthd
holthd
Flag of Norway image

Have you tried using RunDLL32 instead of AddWindowsPrinterConnection as explained in KB297454 under More Information?

-Daniel
Avatar of LeighWardle

ASKER

Hi Daniel,

I am struggling with syntax errors in the line that start with Wshell.Run.

Here's the sample from KB297454:

Dim WshShell

Set WshShell = CreateObject("WScript.Shell")
Wshell.Run "RunDLL32 <\\server\share\drvsrv,Install> "<\\server\share>", 1, True
Set WshShell = Nothing

My printer share is \\server2008\Kylie

Can you show me what the Wshell.Run line should be?

Thanks,

Regards,
Leigh
Leigh, I see Microsoft has made a typo in their example that will result in a syntax error. To define strings in VBScript you enclose a series of characters in apostrophes ("). On the Run line they've setup one string and started another but I'm not certain how the buildup should be. They've really been sloppy on this one because looking at it I see they've actually made another syntax error on the same line(!) - there's nothing called Wshell, it's WshShell.

Google returns a larger number of articles using the below syntax instead of the one in KB297454. I'd recommend you give that a go instead. Find it in a script i wrote for you below.
rundll32 printui.dll,PrintUIEntry /in /q /n\\servername\printername

For more options and command line arguments paste the following command in CMD
rundll32 printui.dll,PrintUIEntry
Good sources on this method: http://www.computerperformance.co.uk/Logon/logon_printer_computer.htm, http://support.microsoft.com/kb/189105

If the script causes any flashing windows you can hide them by changing the number on line 5 from 1 to 0. If you put this into production you should remove lines 6-9 as they are for testing only.

I'm not at work today so I cannot test my script. Please let me know if you run into any problems.
-Daniel

PRINTER = "\\server2008\Kylie"

Set WshShell = CreateObject("Wscript.Shell")
'Add printer connection, silent
int_returnCode = WshShell.Run("rundll32 printui.dll,PrintUIEntry /in /q /n" & PRINTER, 1, True)
'<---TESTING
Wscript.Echo "Return code: " & int_returnCode
WshShell.Run "Control printers",1,false
'TESTING--->
Set WshShell = Nothing

Open in new window

Hi Daniel:

Your latest code runs!

When I run it as a standard user without admin rights I get the message:

You do not have sufficient access to your computer to connect to the selected printer.

When I run it as an administrator I get the message:

The server for the 'Kyocera FS-2020D KX' printer does not have the correct printer driver installed. If you want to search for the proper driver, click OK. Otherwise, click Cancel and contact your network administrator or original equipment manufacturer for the correct printer driver.


Clicking OK took me to a dialog that makes me look for a *.inf file.

This would be way too hard to do for 100 workstations!!!!
There must be an easier way.
Is this trouble caused by us using a different driver on the Server to what's used on the workstations?

Regards,
Leigh

Does it work if you try to add the Printer manually as a standard user?
There's three potential problems I can think of; A) the driver is not installed properly on the server, B) the CPU architecture on the server and clients are different (Google "Additional driver") or C) the printer connection on the client has the same name as the new one and has not been removed.

please check these scenarios and report back.
good night from Norway -Daniel
Hi Daniel,

Here is feedback on your suggestions:

>> Does it work if you try to add the Printer manually as a standard user?

The printer that gives the problem is a Kyocera 2020D.

There are 3 choices of driver that includes the string "2020D":

Kyocera FS-2020D
Kyocera FS-2020D KX
Kyocera FS-2020D (KPDL)

For each choice of driver I have created a shared printer with a different name:

Kylie Kyocera FS-2020D
Kylie Kyocera FS-2020D KX
Kylie Kyocera FS-2020D (KPDL)

Doing a manual "Add Printer" for each of the 3 printers gives an error message like "server for 'Kyocera FS-2020D KX" printer does not have the correct printer driver installed"


>> There's three potential problems I can think of;

>> A) the driver is not installed properly on the server,

Each time I created each printer I asked for the driver to be replaced.

>> B) the CPU architecture on the server and clients are different

I have got everything working for a Kyocera FS-2000D printer, so that discounts that theory.

>> or C) the printer connection on the client has the same name as the new one >> and has not been removed.

No printer connections on the client have names like the ones I use on the Server.

Regards,
Leigh


ASKER CERTIFIED SOLUTION
Avatar of holthd
holthd
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yelbaglf
You'll need both Server 2008 32-bit or 64-bit, depending on the version of 2008, printer drivers, as well as the XP 32-bit or 64-bit, depending on the version of XP, drivers installed on the print server.  So, once you have both 2008 and XP drivers installed, your script should work fine.

So, if you are using the 'Kyocera FS-2020D' driver, then you'll need to install the Server 2008 version of the Kyocera FS-2020D driver, as well as the identical XP version as an additional driver on the server BUT specific to whichever CPU architecture you are using for server and client respectively. (64-bit or 32-bit)
Thanks, Daniel, for a great piece of detective work!