Win32 error code 2 when using prndrvr.vbs with latest HP Print Drivers

E

ejmichaud

I have been using prndrvr.vbs and prnmgr.vbs to automate the
installation of any one of the hundreds of printers in our
organization. However recently I have been unable to use prndrvr.vbs
to install new HP print drivers.

Here is a typical command line that works fine to add a driver:
cscript c:\test\prndrvr.vbs -a -h "C:\Test\4100" -i
c:\test\4100\hp4100p5.inf -m "HP LaserJet 4100 PCL 5e"

HP's new drivers have a different .inf format and when I use the same
command line to install those new format drivers, I receive an error.
Here is a typical command line that would throw an error:
cscript c:\test\prndrvr.vbs -a -h "C:\Test\3800" -i
c:\test\3800\hp3800b.inf -m "HP Color LaserJet 3800 PCL 6"

The error I receive is as follows:
Unable to add printer driver HP LaserJet 3800 PCL 6 Win32 error code 2

With debug turned on:
Debug: In function ParseCommandLine
Debug: In function AddDriver
Unable to add printer driver HP Color LaserJet 3800 PCL 6 Win32 error
code 2

What do I mean by new format driver? Well, without posting the whole
driver .inf here is an example of a driver's .inf [Strings] section
that works fine:
[Strings]
Printer1="HP LaserJet 4100 PCL 5e"
DiskID1="HP LaserJet 4100 PCL 5e Disk 1"
DiskID2="HP LaserJet 4100 PCL 5e Disk 2"
DiskID3="HP LaserJet 4100 PCL 5e Disk 3"
HPDC_MONITOR="HP Master Monitor,HPBMMON.DLL"

Here is an example of a driver's .inf [Strings] section that doesn't
work:
[Strings]
PrinterClassName="Printers"
DiskID="HP Color LaserJet 3800 PCL Printer Driver Disk"
PRINT_PROCESSOR="HPZPP41w,hpzpp41w.DLL"
HP="HP"
HP_Mombi_Driver_Name="HP Color LaserJet 3800 PCL 6"
HP_Wizard_Driver_Name="HP Color LaserJet 3800 PCL6"

Any HP driver that has a driver who's .inf [Strings] section looks
similar to the first posting works fine. Any HP driver that has a
driver who's .inf [Strings] section looks similar to the second posting
failes with the "Win32 error code 2" error.

Anyone have any ideas? Anyone else run into this problem?

Eric
 
E

ejmichaud

Alan said:
error 2 is File Not Found.

Are all the files in c:\test\3800 or in subdirectories under this?

Did you attempt using both driver names with the same failure?

--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.

Yes, all the driver files are in the C:\Test\3800 folder. If I install
the driver manually using the UI it installs without any issues.

By using both driver names I am assuming you are referring to "HP Color
LaserJet 3800 PCL 6" and "HP Color LaserJet 3800 PCL6". If I try the
other, with the following command line:
cscript c:\test\prndrvr.vbs -a -h "C:\Test\3800" -i
c:\test\3800\hp3800b.inf -m "HP Color LaserJet 3800 PCL6"

I get the following error:
Debug: In function ParseCommandLine
Debug: In function AddDriver
Unable to add printer driver HP Color LaserJet 3800 PCL6 Win32 error
code 87

The big difference with receiving error code 87 and error code 2 is the
time in which the errors are received. An error code of 87 is received
as soon as the command is ran, where as the error code 2 takes about 10
seconds to return the error.

If on the command line I specify a .inf that doesn't exist, I receive
error code 87, if I specify a Driver name that doesn't exist in the
..inf I receive an error code 87. It appears to me that file not found,
or driver entry not found would result in an error code of 87.

I am curious, can anyone install the HP Color LaserJet 3800 PCL6 driver
using prndrvr.vbs? You can find the driver here:
http://h20000.www2.hp.com/bizsuppor...&swLang=8&mode=2&taskId=135&swItem=lj-35621-2
 
A

Alan Morris [MSFT]

error 87 is invalid parameter.

--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.

error 2 is File Not Found.

Are all the files in c:\test\3800 or in subdirectories under this?

Did you attempt using both driver names with the same failure?

--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no
rights.

Yes, all the driver files are in the C:\Test\3800 folder. If I install
the driver manually using the UI it installs without any issues.

By using both driver names I am assuming you are referring to "HP Color
LaserJet 3800 PCL 6" and "HP Color LaserJet 3800 PCL6". If I try the
other, with the following command line:
cscript c:\test\prndrvr.vbs -a -h "C:\Test\3800" -i
c:\test\3800\hp3800b.inf -m "HP Color LaserJet 3800 PCL6"

I get the following error:
Debug: In function ParseCommandLine
Debug: In function AddDriver
Unable to add printer driver HP Color LaserJet 3800 PCL6 Win32 error
code 87

The big difference with receiving error code 87 and error code 2 is the
time in which the errors are received. An error code of 87 is received
as soon as the command is ran, where as the error code 2 takes about 10
seconds to return the error.

If on the command line I specify a .inf that doesn't exist, I receive
error code 87, if I specify a Driver name that doesn't exist in the
.inf I receive an error code 87. It appears to me that file not found,
or driver entry not found would result in an error code of 87.

I am curious, can anyone install the HP Color LaserJet 3800 PCL6 driver
using prndrvr.vbs? You can find the driver here:
http://h20000.www2.hp.com/bizsuppor...&swLang=8&mode=2&taskId=135&swItem=lj-35621-2
 
E

ejmichaud

Alan I appreciate your assistance and information regarding this
problem I am having. I am curious if you are able to install this
print driver using prndrvr.vbs?

Thanks
Eric
 
A

Alan Morris [MSFT]

No it fails with file not found. Can you substitute rundll32 printui.dll
for your scenario. I forwarded the info to one of the devs. prndrvr.vbs
just invokes rundll32 interfaces.

did you expand the 26 cabs in the package and attempt to install with a flat
file share?

this works
G:\hp3800>rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /f
G:\hp3800\hpc3800c.inf /r "lpt1:" /m "HP Color LaserJet3800 PCL 6"

G:\hp3800>rundll32 printui.dll,PrintUIEntry /ia /K /m "HP Color LaserJet
3800 PCL 6" /h "Windows NT x86" /v 3 /f G:\hp3800\hpc3800c.inf


this fails

G:\hp3800>prndrvr -a -m "HP Color LaserJet 3800 PCL 6" -i
G:\hp3800\hpc3800c.inf -h G:\hp3800
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Unable to add printer driver HP Color LaserJet 3800 PCL 6 Win32 error code 2

--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.
 
E

ejmichaud

I had actually already gone down that road and found as you found that
the rundll32 printui.dll (with /ia switch) does work for this driver.
I modified my scripts to use this instead of using prndrvr.vbs. Oddly
however, for this driver I cannot use the /q switch for quiet. The
switch works with all the other drivers except the drivers that have
this different type of .inf file format. It appears that HP is now
doing something odd in their print drivers that obviously meets the
standards however causes issues with prndrvr.vbs as well as rundll32
printui.dll. For what ever reason, HP's (what I call new .inf file
format) appears to now be being used in many of the new device drivers
they are releasing.

I am just happy I was able to find a work around. It would be great if
you could pass this information along to those who can correct the
problem, but I guess that would be under the assumption that either of
these options will work under future versions of Windows.

I didn't try extracting the cab files. I do have a workaround so I am
going to go with that.

Thanks for you assistance.
Eric Michaud
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top