Win32 error code 2 when using prndrvr.vbs with latest HP Print Drivers
We have more than 100 printers running in our company. In order to automate the installation of any of the printers i use prndrvr.vbs and prnmgr.vbs. I was using this since years but since yesterday there seems to be some problem. I was trying to install a new HP Printer driver using the same prndrvr.vbs but it wont allow me to that anymore. I use to the run the following typical command line that works fine to add a driver:
Quote:
cscript c:\test\prndrvr.vbs -a -h "C:\Test\4100" -i
c:\test\4100\hp4100p5.inf -m "HP LaserJet 4100 PCL 5e"
I think this is because HP's new drivers have a different .inf format, hence i am getting the error message when trying to use the same command line. The error message says something like this: "Unable to add printer driver HP LaserJet 3800 PCL 6 Win32 error code 2"
When i run the debug, i get this result:
Quote:
Debug: In function ParseCommandLine
Debug: In function AddDriver
Unable to add printer driver HP Color LaserJet 3800 PCL 6 Win32 error code 2
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"
Please help.
Re: Win32 error code 2 when using prndrvr.vbs with latest HP Print Drivers
As the error says "File Not Found", can you tell me if the files kept in c:\test\3800 or in subdirectories under this? Also did you tried using both driver names with the same failure?
Re: Win32 error code 2 when using prndrvr.vbs with latest HP Print Drivers
Thank you for the help. Yes, i have kept all driver files under C:\Test\3800 folder. When i try to install the driver manually using the UI, i dont get any problem and it gets installed without any problem. 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, it gives me the following error message:
Quote:
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
So what now? Can anyone please help me out installing the HP Color LaserJet 3800 PCL6 driver using prndrvr.vbs? If you want you can see the HP drivers here.
Re: Win32 error code 2 when using prndrvr.vbs with latest HP Print Drivers
Hello Lopa, I will suggest you try out rundll32 printui.dll as a substitute and see what happens. I tried forwarding the info to one of the devs. prndrvr.vbs just invokes rundll32 interfaces. Also you should have tried expanding the 26 cabs in the package and attempt to install with a flat file share. See if it helps.
By the way i have seen many cases where this has worked:
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
And this is what failed every time:
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
Re: Win32 error code 2 when using prndrvr.vbs with latest HP Print Drivers
Well as far as i know the print scripts can only run without dialogs. This is why no unsigned drivers can be installed using prndrvr.vbs. Hope you got my point.