Reputation: 170
I'm trying to install a printer driver using WMI and a VBScript but I keep getting the error code 2146500025 from the WMI AddPrinterDriver function.
What am I doing wrong? I need to install 2 drivers (1 Dell and 1 Lexmark) and both instances return the same error code. The drivers are signed and the .cat file is present with the .inf. The certificates are also valid (Expires late 2016)
Set objDriver = oWmi.Get("Win32_PrinterDriver")
objDriver.Name = DRIVERNAME
objDriver.SupportedPlatform = "Windows NT x86"
objDriver.Version = "3" 'Win2K
objDriver.FilePath = "c:\drivers\printers\Lexmark_Universal_PS"
objDriver.InfName = "c:\drivers\printers\Lexmark_Universal_PS\LMUD1n40.inf"
wmiResult = objDriver.AddPrinterDriver(objDriver)
If wmiResult<>0 Then
wscript.echo "WMI " & wmiResult
End If
If Err.Number<>0 Then
wscript.echo Err.Description
End If
Upvotes: 1
Views: 393
Reputation: 170
Turned out that the files were tampered with prior to me receiving them. This in turn broke the signatures and prevented the drivers from installing successfully.
Upvotes: 1