Hello
I have created a vbscript by cannibalising others on the interweb to install a printer port, the driver and then the actual printer. On some machines it works, on others i get the following error:
Script: Install.vbs
Line: 34
Char: 1
Error: Generic Failure
Code: 80041001
Source: SWbemObjectEx
the vbscript looks like this:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &"\root\cimv2")
Set objNewPort = objWMIService.Get _
("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = "IP_x.x.x.206"
objNewPort.Protocol = 1
objNewPort.HostAddress = "x.x.x.206"
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = False
objNewPort.Put_
objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", True
Set objDriver = objWMIService.Get("Win32_PrinterDriver")
objDriver.Name = "HP Color LaserJet CP3505 PCL 6"
'objDriver.SupportedPlatform = "Windows NT x86"
'objDriver.Version = "3"
objInfname = "\\x.x.x.5\Apps\Printer Drivers\Konica Minolta BizHub C360\KOAZ8J__.inf"
intResult = objDriver.AddPrinterDriver(objDriver)
Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_
objPrinter.DriverName = "KONICA MINOLTA C360SeriesPCL"
objPrinter.PortName = "IP_x.x.x.206"
objPrinter.DeviceID = "KONICA MINOLTA C360SeriesPCL"
objPrinter.Location = "Printer Location"
objPrinter.Network = True
objPrinter.Shared = False
objPrinter.Put_
can anyone shed any light on this problem???
Thanks