Results 1 to 5 of 5

Thread: telnet

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    3

    Question telnet

    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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: telnet

    Try
    VB Code:
    1. Text1.Text = WshShell.SendKeys "systat"

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    3

    Re: telnet

    That does not function

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: telnet

    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)
    VB Code:
    1. cscript myscript.vbs > d:\temp\myscript.txt

  5. #5
    Hyperactive Member Rattlerr's Avatar
    Join Date
    Jul 2005
    Location
    FloralCity,Florida
    Posts
    269

    Re: telnet

    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..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width