1
我試圖安裝使用WMI和VBScript的打印機驅動程序,但我一直從WMI AddPrinterDriver函數獲取錯誤代碼2146500025。VBScript打印機驅動程序安裝拋出WMI錯誤-2146500025
我在做什麼錯?我需要安裝2個驅動程序(1個Dell和1個Lexmark),並且兩個實例都返回相同的錯誤代碼。驅動程序已簽名且.cat文件與.inf一起存在。證書也有效(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