Facebook
From Mik, 6 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 104
  1. strComputer = "."
  2. Set objWMIService = GetObject("winmgmts:" _
  3.     & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
  4.  
  5. Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_
  6.  
  7. objPrinter.DriverName = "HP LaserJet 4000 Series PS"
  8. objPrinter.PortName   = "IP_169.254.110.160"
  9. objPrinter.DeviceID   = "ScriptedPrinter"
  10. objPrinter.Location = "USA/Redmond/Building 37/Room 114"
  11. objPrinter.Network = True
  12. objPrinter.Shared = True
  13. objPrinter.ShareName = "ScriptedPrinter"
  14. objPrinter.Put_
  15.