So I was trying to find a way to schedule telnet commands, personally all I could find was commercial programs that you need to pay for and that was something I wasn’t wiling to do. Luckily I stumbled across this little gem called Telnet Scripting Tool v1.0. The program is by Albert Yale. Unfortunately the official site (http://ay.home.ml.org/) for the program doesn’t exist any more so I will provide a link to the program at the end of this article.
This program is pretty simple to use really. All you do is create a script file in notepad that contains the commands you wish to use in telnet.
Script
The following code should be placed in a text file. e.g scriptname.txt
Example:
(This example should reset any CPE Billion router – e.g 7402VGO)
192.168.1.254 23
WAIT "Login:"
SEND "admin\m"
WAIT "Password:"
SEND "default\m"
WAIT "admin>"
SEND "system restart\m"
That looks pretty simple doesn’t it. The first line of your script is always the address and port number. If you are using TCP port 23 then you don’t really have to say it, it’s considered default. First thing we do is WAIT
"Login:"
peace of text. Once it has done this we then respond with SEND "admin\m"
, this give the router the login name admin
, and the \m
represents the user pressing enter.
Thats pretty much it WAIT
then respond to the WAIT
by sending a command using SEND
Command Line
Once you have completed your script of the commands you wish to use you are now ready to issue a command to run your script.
tst10.exe /r:scriptname.txt
This causes the script file that you created to run, if you follow the example and have a billion router or another router that has the same telnet interface your modem will reset.
Scheduling
It’s now simply a matter of using Windows Scheduled Tasks to execute the command line at the time you wish.
How To Schedule Tasks in Windows
Conclusion
Now thats not very hard to use is it, and is very useful if you need to force a reboot on a device with a telnet interface.
Thank you, thank you, thank you!!