Jump to content

Sending text for a minimized/hidden window


Recommended Posts

Since I live on a hill our telephone line seems to go all over the place to get here. Unfortunately, at one point in the line it's really messed up which makes my DSL router go offline until I reset it physically. I made a script in AutoIt (Of course!) to telnet into the router and reset it automatically when I'm away (Or supremely lazy, it's only 5 feet away). I can't find a way to minimize the telnet window though and still be able to send text to it. And it gets rather irritating when I have to stop working on whatever so I won't mess up the commands it sends to the open telnet window. Could my script execute the reset silently? Here's the reset script:

BlockInput(1)
FileWrite(@ScriptDir & "\Reset Log.txt", "Time " & @HOUR & ":" & @MIN & " Day " & @MDAY & @CRLF); so I know when it reset
Run(@ComSpec, @SystemDir)
Sleep(1000)
Send("Telnet")
Sleep(500)
Send("{ENTER}")
Sleep(1000)
Send("open 192.168.0.1")
Sleep(500)
Send("{ENTER}")
Sleep(1000)
Send("example"); username
Sleep(500)
Send("{ENTER}")
Sleep(1000)
Send("example"); password
Sleep(1000)
Send("{ENTER}")
Sleep(2000)
Send("reboot")
Sleep(500)
Send("{ENTER}")
Sleep(5000)
ProcessClose("telnet.exe")
ProcessClose("cmd.exe")
BlockInput(0)
Exit

By the way, This is activated by another script when I'm away that checks for internet connection.

Prove, and I will believe...
Link to comment
Share on other sites

Thank you so much! I never would have considered TCP+Telnet but I guess that it's pretty much the same thing. Now I just need a script that questions if I searched my topic before I make a post...

Prove, and I will believe...
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...