M
M
Maxim Maximov2015-02-22 23:15:39
telnet
Maxim Maximov, 2015-02-22 23:15:39

How to automate Telnet commands?

It is necessary to write an automated telnet login script and send commands to reconnect the D-Link 2640U modem. You need to send the following commands.
o 192.168.1.1 //5 sec
pause admin //3 sec pause
admin //3 sec pause
ppp config 0.8.35 down //5 sec pause
ppp config 0.8.35 up //5 sec
pause logout //5 sec pause
q

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Saboteur, 2015-02-23
@saboteur_kiev

I was also looking for a simple console telnet client with the ability to automate, but eventually settled on perl with telnet libya
You can look something at perl/php/python
www.perlfect.com/articles/telnet.shtml
stackoverflow.com/ questions/905348/telnet-connecti...

A
Alexander Karabanov, 2015-02-23
@karabanov

Expect, Autoit.

G
grafist02511, 2016-10-09
@grafist02511

Save as name.vbs

set my = WScript.CreateObject("WScript.Shell")
my.run("C:\Windows\System32\cmd.exe")
WScript.Sleep 3000
my.SendKeys("telnet 192.168.0.1~")
WScript.Sleep 5000
my.SendKeys("admin~")
WScript.Sleep 3000
my.SendKeys("admin~")
WScript.Sleep 3000
my.SendKeys("ppp config 0.8.35 down~")
WScript.Sleep 5000
my.SendKeys("ppp config 0.8.35 up~")
WScript.Sleep 5000
my.SendKeys("q~")

M
Maxim Maksimov, 2015-02-23
@ZaraBot

Unfortunately, I don't know Perl, maybe there are simpler options. It is necessary that the script be executed automatically through the task scheduler. Or maybe there is a program that allows you to automate the execution of telnet commands.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question