?
Solved

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

Posted on 2011-02-19
10
Medium Priority
?
4,144 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 7

Expert Comment

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

-Daniel
0
 
LVL 1

Author Comment

by:LeighWardle
ID: 34935435
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
ID: 34935553
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:LeighWardle
ID: 34935617
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
ID: 34935660
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
 
LVL 1

Author Comment

by:LeighWardle
ID: 34935774
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 2000 total points
ID: 34937690
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
ID: 34938952
0
 
LVL 11

Expert Comment

by:yelbaglf
ID: 34939628
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
ID: 34940612
Thanks, Daniel, for a great piece of detective work!
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
Suggested Courses

777 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