Solved

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

Posted on 2011-02-19
10
4,008 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:LeighWardle
  • 5
  • 4
10 Comments
 
LVL 7

Expert Comment

by:holthd
Comment Utility
Have you tried using RunDLL32 instead of AddWindowsPrinterConnection as explained in KB297454 under More Information?

-Daniel
0
 
LVL 1

Author Comment

by:LeighWardle
Comment Utility
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
0
 
LVL 7

Expert Comment

by:holthd
Comment Utility
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

0
 
LVL 1

Author Comment

by:LeighWardle
Comment Utility
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

0
 
LVL 7

Expert Comment

by:holthd
Comment Utility
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
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 1

Author Comment

by:LeighWardle
Comment Utility
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


0
 
LVL 7

Accepted Solution

by:
holthd earned 500 total points
Comment Utility
Thanks for the feedback Leigh. I think we can narrow it down to a problem or misconfiguration on the printer queue on Server2008.
Please have a look at http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/SBS_Small_Business_Server/Q_24456047.html.This thread is regarding the same error message and it was solved by adding Additional drivers to the printer.
What OS is running on your clients? XP?

-Daniel
0
 
LVL 1

Author Comment

by:LeighWardle
Comment Utility
0
 
LVL 11

Expert Comment

by:yelbaglf
Comment Utility
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)
0
 
LVL 1

Author Closing Comment

by:LeighWardle
Comment Utility
Thanks, Daniel, for a great piece of detective work!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Redirected folders in a windows domain can be quite useful for a number of reasons, one of them being that with redirected application data, you can give users more seamless experience when logging into different workstations.  For example, if a use…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now