thunder88
asked on
vb Script
I need a script which could do the following
Create a TCP/IP port for Printer xx.xx.xx.xx
Install a UPD PCL 6 driver
and give prompt once the driver is installed.
Thanks
Create a TCP/IP port for Printer xx.xx.xx.xx
Install a UPD PCL 6 driver
and give prompt once the driver is installed.
Thanks
ASKER
and where is it going to get the driver from...
please send me where can I add path to the driver.
please send me where can I add path to the driver.
ASKER
I am trying the this script, but this only creates the port but doesn't install the driver can you please tell me what I am doing wrong in it.
On Error Resume Next
'SETS 'LOAD DRIVER' PRIVILEGE.
Set objWMIService = GetObject("Winmgmts:")
objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", True
'SETS PRINTER PORT.
Set objNewPort = objWMIService.Get _
("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = "IP_10.1.10.16"
objNewPort.Protocol = 1
objNewPort.HostAddress = "10.1.10.16"
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = False
objNewPort.Put_
'SETS PRINTER TO PORT.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", True
Set objDriver = objWMIService.Get("Win32_PrinterDriver")
set objShell = CreateObject("Wscript.Shell")
objDriver.Name = "HP Universal Printing PCL 6"
objDriver.SupportedPlatform = "Windows NT x86"
objDriver.Version = "3"
objPrinter.PortName = "IP_10.1.10.16"
objPrinter.DeviceID = "HPLaserJet_4350_Staff1"
objPrinter.Location = "Staff1"
objDriver.DriverPath = "C:\Documents and Settings\xyz\My Documents\Downloads\upd-PCL6-X32-5_2_6_9321"
objDriver.Infname = "C:\Documents and Settings\xyz\My Documents\Downloads\upd-PCL6-X32-5_2_6_9321\hpcu112c.inf"
intResult = objDriver.AddPrinterDriver(objDriver)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I fixed it by my own
well of course you have to download the drivers, put it on a local or network path and refer to that in the script.
ASKER
I have to work around by my own
Open in new window