|
|
Ok, I am writing a vbscript to install network printers onto
workstations. The script seems to work fine, except it assumes that the
printer driver is already installed. So is there a way to install a
driver using vbscript, or perhaps is there another way of installing a
driver to a workstation like copying the files into a specific directory
or something?
Here is the script:
-----------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewPort = objWMIService.Get ("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = "IP_10.0.20.201"
objNewPort.Protocol = 1
objNewPort.HostAddress = "10.0.20.201"
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = True
objNewPort.Put_
Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_
objPrinter.DriverName = "HP LaserJet 4000 Series Ps"
objPrinter.PortName = "IP_10.0.20.201"
objPrinter.DeviceID = "ScriptedPrinter"
objPrinter.Location = "Ops/2floor"
objPrinter.Network = True
objPrinter.Shared = False
objPrinter.Put_
1 responses total.
Nevermind, figured it out:
-----------------
set objDriver = objWMIService.Get("Win32_PrinterDriver")
objDriver.Name = "KONICA MINOLTA 350/250/200 PCL"
objDriver.SupportedPlatform = "Windows NT x86"
objDriver.Version = "3"
objDriver.FilePath = "c:\\drivers\\printers\\"
objDriver.Infname = "c:\\drivers\\printers\\CLJ2600.inf"
intResult = objDriver.AddPrinterDriver(objDriver)
Response not possible - You must register and login before posting.
|
|
- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss