here is my code. Everytime I try to add a print driver, I get error
code 87. I try to use \\ instead of \ in the driver path and inf and it still
does not work. I am able to install a printer if the driver already exists on
the remote machine, but if I have to install a driver, it will not work and
returns error code 87. I have tried prndrvr.vbs as well and I can install the
driver to the local workstation, but once I try remote, it does not work. Any
ideas?
objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
objDriver = objWMIService.Get("Win32_PrinterDriver")
objWMIService.Security_.Privileges.AddAsString("SeLoadDriverPrivilege", True)
objDriver.Name = "Lexmark E250dn"
objDriver.SupportedPlatform = "Windows NT x86"
objDriver.Version = "3"
objDriver.FilePath =
"C:\\lexmark\\Drivers\\Drivers\\Print\\Win_2KXP\\"
objDriver.Infname =
"C:\\lexmark\\Drivers\\Drivers\\Print\\Win_2KXP\\LMABJ740.inf"
Dim intResult = objDriver.AddPrinterDriver(objDriver)
Bookmarks