Facebook
From Mik, 6 Days ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 51
  1. ' Install a Printer Driver not Found in Drivers Cab
  2.  
  3.  
  4. strComputer = "."
  5. Set objWMIService = GetObject("winmgmts:" _
  6.     & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
  7. objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", True
  8.  
  9. Set objDriver = objWMIService.Get("Win32_PrinterDriver")
  10.  
  11. objDriver.Name = "NewPrinter Model 2900"
  12. objDriver.SupportedPlatform = "Windows NT x86"
  13. objDriver.Version = "3"
  14. objDriverPath = "C:\Scripts\NewPrinter.dll"
  15. objInfname = "C:\Scripts\NewPrinter.inf"
  16. intResult = objDriver.AddPrinterDriver(objDriver)