Results 1 to 5 of 5

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

  1. #1
    Join Date
    May 2010
    Posts
    65

    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:

    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:
    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.

  2. #2
    Join Date
    Jan 2006
    Posts
    605

    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?

  3. #3
    Join Date
    May 2010
    Posts
    65

    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:

    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.

  4. #4
    Join Date
    Sep 2005
    Posts
    179

    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

  5. #5
    Join Date
    Sep 2004
    Posts
    208

    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.

Similar Threads

  1. Replies: 3
    Last Post: 28-07-2010, 10:19 PM
  2. Error code while installing latest patch for joomla
    By Mind It in forum Software Development
    Replies: 3
    Last Post: 29-10-2009, 03:33 PM
  3. Error code 87 when installing remote print drivers...
    By MadKovalchuk17 in forum Windows Server Help
    Replies: 2
    Last Post: 29-01-2008, 09:22 PM
  4. Replies: 3
    Last Post: 17-11-2006, 01:41 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,917,784.00040 seconds with 16 queries