none
prndrvr.vbs Win32 error code 87

    Question

  • Hi Guys,

    Im having some trouble trying to get prndrvr.vbs to work and keep getting Win32 error code 87. Ive tried googling it but it just says wrong syntax but ive gone over and over it and it and i carnt find them problem. Here are the two im using:

    cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -a -m "Brother FAX-8750P" -v 3 -e "Windows x64" -h C:\Windows\System32\DriverStore\FileRepository\prnbr001.inf_amd64_neutral_aad7da6d7cd23042 -i C:\Windows\System32\DriverStore\FileRepository\prnbr001.inf_amd64_neutral_aad7da6d7cd23042\prnbr001.Inf

    cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -a -m "Lexmark Universal XL" -v 3 -e "Windows x64" -h C:\Windows\System32\DriverStore\FileRepository\lmud0c40.inf_amd64_neutral_742d8fe9350bbd47 -i C:\Windows\System32\DriverStore\FileRepository\lmud0c40.inf_amd64_neutral_742d8fe9350bbd47\LMUD0C40.inf

    I have made sure that "Everyone" Has read and execute permissions on the filerepository folder. I have made sure the folder exists. Im not sure. Please help!

    Tuesday, February 22, 2011 5:06 PM

Answers

  • Hi,

    You're asking for help with a standard Microsoft tool (which happens to be a VBS script - prndrvr.vbs) - we (the forum moderators) didn't write that script and nobody here seems to have the exact hardware you're trying to use and therefore we cannot reproduce your specific problem. We've already provided suggestions, but if those are not successful, there's not much else we can do for you since this forum does not guarantee solutions.

    HTH,

    Bill

    Friday, February 25, 2011 3:31 PM
    Moderator

All replies

  • What is the exact error message you get? If there is a line number in the message, what is that? Error code 87 means nothing to us.

    Richard Mueller


    MVP ADSI
    Tuesday, February 22, 2011 5:22 PM
    Moderator
  • Hi,

    'net helpmsg 87' - 'The parameter is incorrect' - Win32 error code ERROR_INVALID_PARAMETER.

    HTH,

    Bill

    Tuesday, February 22, 2011 5:26 PM
    Moderator
  • Unable to add printer driver Lexmark Universal XL Win32 error code 87

    Yet the top scipt for Brother FAX-850P works fine. This is what im not understanding.

    Tuesday, February 22, 2011 5:31 PM
  • Hi,

    Win32 error 87 is ERROR_INVALID_PARAMETER (localized English string "The parameter is incorrect"). It could be that you are passing invalid parameters to the prndrvr.vbs script; it could also mean there is an invalid setting in the INF file you are trying to use (I don't know which).

    Bill

    Tuesday, February 22, 2011 5:38 PM
    Moderator
  • The error "Unable to add printer" in prndrvr.vbs is raised on the last statement in this snippet:

    set oDriver = oService.Get("Win32_PrinterDriver")
      else
        AddDriver = kErrorFailure
        exit function
      end if
      '
      ' Check if Get was successful
      '
      if Err.Number = kErrorSuccess then
        oDriver.Name       = strModel
        oDriver.SupportedPlatform = strEnvironment
        oDriver.Version      = uVersion
        oDriver.FilePath     = strFilePath
        oDriver.InfName      = strInfFile
    
        uResult = oDriver.AddPrinterDriver(oDriver)

     

    The problem must be in one of the 5 properties passes to the Win32_PrinterDriver.AddPrinterDriver method. This reference might help:

    http://msdn.microsoft.com/en-us/library/aa394366(VS.85).aspx

    I can only note that InfName is the name of the inf file, not the path. Also, FilePath has backslashes doubled. Does this help?

    Richard Mueller


    MVP ADSI
    Tuesday, February 22, 2011 6:33 PM
    Moderator
  • After the -e parameter i have the path with is :

    C:\Windows\System32\DriverStore\FileRepository\lmud0c40.inf_amd64_neutral_742d8fe9350bbd47\

    And then -i for the full path which is:

    C:\Windows\System32\DriverStore\FileRepository\lmud0c40.inf_amd64_neutral_742d8fe9350bbd47\LMUD0C40.inf

    I carnt see the double slashes though. Anyone any ideas, im lost with this one im affraid.

    Cheers,

    Eddie

    Wednesday, February 23, 2011 4:55 PM
  • Does anyone know of a powershell resource that doesnt use prndvr?
    Wednesday, February 23, 2011 5:10 PM
  • I don't use this program, but the documentation seems to indicate that the -i parameter should not have the path, just file name. It seems to also indicate that the -h parameter should have slashes doubled. Can you try the following:

    cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -a -m "Brother FAX-8750P" -v 3 -e "Windows x64" -h C:\\Windows\\System32\\DriverStore\\FileRepository\\prnbr001.inf_amd64_neutral_aad7da6d7cd23042 -i prnbr001.Inf

     

    If that doesn't work, I would try without doubling the slashes, but using only the filename in the -i parameter.

    Richard Mueller


    MVP ADSI
    Wednesday, February 23, 2011 5:11 PM
    Moderator
  • Just states syntax is incorrect.

    The inf file name must be the fully qualified. If the inf name is not specified, the script uses one of the inbox printer inf files in the inf subdirecory of the windows directory. If the driver path is not specified, the script searches for driver files in the driver.cab file

    Ive tried double slashes in the full qualified path and this also doesnt work.

    Ive tried 3 differant vertions of the print driver and still no luck.

    Wednesday, February 23, 2011 6:46 PM
  • Ive tried the following vertions now:

    lmud0c40.inf_amd64_neutral_1d114dbbfc68cab8

    lmud0c40.inf_amd64_neutral_742d8fe9350bbd47

    lmud0c40_1.6_73D81619CFDF690D9CE952DB82AFEED7

    Ive also tried copying them in a folder on the C: to see if the UNC path was too long. This alos gave same error.

    Wednesday, February 23, 2011 7:05 PM
  • Hi,

    I recommend contacting the driver manufacturer to find out what the correct technique is for what you want to do (or if it's even possible).

    Bill

    Wednesday, February 23, 2011 9:25 PM
    Moderator
  • Tried that, they dont listern/understand what im trying to do. Nor will they open a case for this to be resolved. Stating this is a problem with the process im using to install the driver. Microsoft say that this is the only supported way to install a print driver. So im stuck in the middle with neither party giving me solution.

    Friday, February 25, 2011 1:35 PM
  • Hi,

    You're asking for help with a standard Microsoft tool (which happens to be a VBS script - prndrvr.vbs) - we (the forum moderators) didn't write that script and nobody here seems to have the exact hardware you're trying to use and therefore we cannot reproduce your specific problem. We've already provided suggestions, but if those are not successful, there's not much else we can do for you since this forum does not guarantee solutions.

    HTH,

    Bill

    Friday, February 25, 2011 3:31 PM
    Moderator
  • Hi it may not be of any help but I get the same Win32 errorcode 87 error when trying to set the serial com port parameters (baud rate, stop bits etc) using the SPORT_SET_STATE subroutine called within VISUAL FORTRAN. It seems to occur when the com port hangs. The Visual manual does not explain the error code at all.
    Thursday, March 08, 2012 1:49 PM
  • Hi,

    I'm not sure how this relates to the thread; in any case, error code 87 is Win32 error ERROR_INVALID_PARAMETER. For standard Win32 error codes, you can use the net helpmsg command to get the error's string representation:

    C:\>net helpmsg 87
    
    The parameter is incorrect.
    

    In any case, this thread is already marked as answered. If you need help, please start a new question (referencing this thread, if appropriate).

    Bill

    Thursday, March 08, 2012 3:37 PM
    Moderator
  • Hi,

    I know that this is an old topic, but I had the same problem and after lots of tries I realized that the name in the parameter -m needs to be the same name found in the last lines of the .inf used in the -i parameter.


    Tuesday, December 11, 2012 7:46 PM
  • Hi

    Windows xp

    Thank you Gustavo Stein.

    So:

    Use the exact name (aka copy) from the inf file.

    Use the full path for the i parameter. (// or h parameter or not needed).

    Greetings.

    Tom

    Monday, July 15, 2013 2:57 PM
  • Hi,

    This question was marked as answered over two years ago. If you still need help, please start a new question. Also keep in mind that this is a forum for scripting questions, not a forum for questions about how to use standard Microsoft-provided tools.

    Bill

    Monday, July 15, 2013 3:11 PM
    Moderator
  • The problem is with your paths in the -i and -h statements. Enclose them in "" and see what that does.

    i was hetting the same error and after fixing the path. issue resolved itself.

    Monday, October 28, 2013 4:10 PM
  • So this is 5 years late, but for any passer-by's who are looking for an answer, I found mine.

    So everyone is right when they say it's an invalid parameter, and usually I find the culprit is the driver name. The name needs to match exactly what the driver has listed. You can find out how the driver is named by opening the INF file.

    For the HP Universal Print Driver, it is named "HP Universal Printing PCL6". In the INF file, you can find this towards the bottom of the INF file.

    [Strings.042A]        ;Vietnamese - Vietnam
    PrinterClassName="Printers"
    DiskID1="HP Universal Printing PCL Printer Driver Disk"
    PRINT_PROCESSOR="hpcpp185,hpcpp185.dll"
    HP="HP"
    HP_Mombi_Driver_Name="HP Universal Printing PCL 6"
    HP_Mombi_Driver_Name_Ver="HP Universal Printing PCL 6 (v6.2.0)"
    HP_DRIVER_REG_PATH="SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Drivers\Version-3"
    HP_MOBILE_USER="Software\Hewlett-Packard\HP Print Settings"
    HP_DIRECT_CONNECT_REG_PATH="Software\Hewlett-Packard\San Diego Shared IO"
    LocaleCABFile ="p6a4viww.cab"
    LANGUAGE_MONITOR="HPMLM180,hpmlm180.dll"
    HP_DRIVER_SUPPORT_NON_HP = "Software\Hewlett-Packard\HP Print Settings"

    • Proposed as answer by toucheuk Thursday, January 18, 2018 3:36 PM
    • Unproposed as answer by toucheuk Thursday, January 18, 2018 3:36 PM
    Wednesday, March 16, 2016 4:17 PM
  • Kevinm92 - cues of guys like u i love the internet :) thank you so much !!
    • Proposed as answer by toucheuk Thursday, January 18, 2018 3:35 PM
    • Unproposed as answer by toucheuk Thursday, January 18, 2018 3:36 PM
    Monday, December 11, 2017 2:17 PM
  • I had this error when trying to install a 32 bit driver on a 64 bit machine.  My script worked without error on 32 bit machines.
    Thursday, January 18, 2018 3:38 PM