Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


color printer

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,26958
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> color printer
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 color printer - 10/14/2005 5:35:43 AM   
  NAVPET

 

Posts: 2
Score: 0
Joined: 10/14/2005
Status: offline
The following code gives me a generic failure on line 25... I have no idea
where im going wrong with this script...I think its not finding the driver on
the server. the path of the server is fine....please help

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
  & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
set objDriver = objWMIService.Get("Win32_PrinterDriver")

'objDriver.SupportedPlatform = "Windows NT x86"
'objDriver.Version = "3"
'objDriverPath = "\\fs\Printers\"
objDriver.Name = "OKI C5300(PCL)"
objInfname = "\\fs\Printers\ok715.inf"
intResult = objDriver.AddPrinterDriver(objDriver)
Wscript.Echo intResult

Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_

objPrinter.DriverName = "OKI C5300(PCL)"
objPrinter.PortName   = "IP_10.10.96.60" 
objPrinter.DeviceID   = "OKI C5300(PCL)"
objPrinter.Location = "Printer Location"
objPrinter.Network = True
objPrinter.Shared = False
objPrinter.Put_

Set objNewPort = objWMIService.Get _
  ("Win32_TCPIPPrinterPort").SpawnInstance_

objNewPort.Name = "IP_10.10.96.60"
objNewPort.Protocol = 1
objNewPort.HostAddress = "10.10.96.60"
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = False
objNewPort.Put_
 
 
Post #: 1
 
 RE: color printer - 10/14/2005 7:06:47 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
Is this the entire script?

Your last line is "objNewPort.Put_"  The The Win32_TCPIPPrinterPort WMI class does not have a Put_ property.

Cybex

< Message edited by Cybex -- 10/14/2005 7:08:26 AM >

(in reply to NAVPET)
 
 
Post #: 2
 
 RE: color printer - 10/16/2005 10:51:17 PM   
  NAVPET

 

Posts: 2
Score: 0
Joined: 10/14/2005
Status: offline
Hello,
  That was the entire script and i thought Win32_TCPIPPrinterPort WMI  does have a put_ property. The script still is not working

(in reply to Cybex)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> color printer Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts