PDA

Click to See Complete Forum and Search --> : telnet


ElMoez
Jan 12th, 2006, 04:41 AM
hello
I'm writing a script which use telnet to monitor a switch

this is my script

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "telnet.exe" & chr(13)
WScript.Sleep 5000
WshShell.SendKeys "open ipAdress"& chr(13)
WScript.Sleep 5000
WshShell.SendKeys "admin" & chr(13)
WScript.Sleep 5000
WshShell.SendKeys "pass" & chr(13)
WScript.Sleep 5000
WshShell.SendKeys "systat" & chr(13)
WScript.Sleep 5000
WshShell.SendKeys "Logout" & chr(13)
WScript.Sleep 5000
WshShell.SendKeys "quit" & chr(13) & chr(13)
WScript.Sleep 5000
WshShell.SendKeys "exit"& chr(13)
WScript.Quit

when i use systat the switch return a statistics about it
i want to return this result to a text file in my computer
how can i do it
some one can help me ?

thx

Hack
Jan 12th, 2006, 07:45 AM
TryText1.Text = WshShell.SendKeys "systat"

ElMoez
Jan 12th, 2006, 08:24 AM
That does not function :(

dglienna
Jan 12th, 2006, 12:12 PM
Download Scriptomatic2 to write scripts for you. I use CSCRIPT to return output to the console. I also can pipe it to a text file with the > parameter (or >> to append it)

cscript myscript.vbs > d:\temp\myscript.txt

Rattlerr
Jan 12th, 2006, 01:47 PM
Going too see if this Scriptomatic2 might help out on some of the Socket Programming i'm working on for C# ,under Socket Programming Therory.. :)