Telnet Scripter Problem

Utilities and tools for networking, routers, setup etc
Post Reply
ivanmil
Newbie
Newbie
Posts: 4
Joined: Fri Mar 14, 2008 9:37 am

Telnet Scripter Problem

Post by ivanmil » Fri Mar 14, 2008 10:19 am

Hello! I have a strange issue with ts.exe. I want to reboot my router (TP-LINK 8811) using a simple script, but when I execute .bat file, nothing happens. The weird thing is that this works with old Yale's scripting tool tst10.exe.
This is a script for ts.exe:

HOST 192.168.1.1 23
WAIT "Login"
SEND "admin\n"
WAIT "Password"
SEND "admin\n"
WAIT ">"
SEND "reboot\n"
WAIT "The system shell is being reset. Please wait..."

and this is the working script for tst10.exe:

192.168.1.1 23
WAIT "Login"
SEND "admin\m"
WAIT "Password"
SEND "admin\m"
WAIT ">"
SEND "reboot\m"
WAIT "The system shell is being reset. Please wait..."

Can someone help me, please? Тhanks in advance.
User avatar
Neo
RouterTech Team
RouterTech Team
Posts: 3586
Joined: Thu Jan 26, 2006 1:09 pm
Contact:

Post by Neo » Fri Mar 14, 2008 1:08 pm

Hi,

What do you see in the Telnet Scripter log as it runs? Can you paste the text here?

If

Code: Select all

WAIT "The system shell is being reset. Please wait..."
is the last line of your script, I would try shortening to something like

Code: Select all

WAIT "system shell"
as you don't need the whole text to be found or perhaps even omit the line altogether.
RouterTech Team and Founding Member
Image
RouterTech Merchandise (UK)
No support via PM, please ask your questions on the forum!
ivanmil
Newbie
Newbie
Posts: 4
Joined: Fri Mar 14, 2008 9:37 am

Post by ivanmil » Fri Mar 14, 2008 2:15 pm

If this is the log you wanted to see:

Checking script (keeping output file)
Running script
Opening connection
˙ý˙ý!˙ű˙ű

BCM96338 ADSL Router
Login:

admin


Password:




>

reboot




The system shell is being reset. Please wait...



End of script
Closed connection.

I tried with just WAIT "system shell" but it didn't help.
User avatar
Neo
RouterTech Team
RouterTech Team
Posts: 3586
Joined: Thu Jan 26, 2006 1:09 pm
Contact:

Post by Neo » Fri Mar 14, 2008 2:33 pm

Thanks for the info.

Try using a delay like this:

Code: Select all

HOST 192.168.1.1 23
WAIT "Login"
SEND "admin\n"
WAIT "Password"
SEND "admin\n"
WAIT ">"
SEND "reboot\n"
DELAY 2
Or just remove the last line

Code: Select all

HOST 192.168.1.1 23
WAIT "Login"
SEND "admin\n"
WAIT "Password"
SEND "admin\n"
WAIT ">"
SEND "reboot\n"
With some routers, they won't reboot until the scripter disconnects (which might not happen if the scripter doesn't pick up on the last line).
RouterTech Team and Founding Member
Image
RouterTech Merchandise (UK)
No support via PM, please ask your questions on the forum!
ivanmil
Newbie
Newbie
Posts: 4
Joined: Fri Mar 14, 2008 9:37 am

Post by ivanmil » Fri Mar 14, 2008 2:46 pm

Wow, that was fast. I appreciate your help.
But those two solutions didn't work either. As I said, very weird, to me, at least.
User avatar
Neo
RouterTech Team
RouterTech Team
Posts: 3586
Joined: Thu Jan 26, 2006 1:09 pm
Contact:

Post by Neo » Fri Mar 14, 2008 3:04 pm

ivanmil wrote:Wow, that was fast. I appreciate your help.
No problem :)
ivanmil wrote:But those two solutions didn't work either.
Ah well - I'm not sure what the solution is. All I can suggest in the mean is that you continue using Yale's tool to reboot your router :)
ivanmil wrote:As I said, very weird, to me, at least.
It's weird for me too, but it's just one of those things. It's probably reliant on timing etc and would require some more playing around with the script. Clearly the telnet scripter can login successfully and gets the router to respond to the reboot command so it's strange the router doesn't actually reboot. You could try inserting a delay before the reboot command is sent and then put a WAIT at the end for something that won't appear.
E.g.

Code: Select all

HOST 192.168.1.1 23
WAIT "Login"
SEND "admin\n"
WAIT "Password"
SEND "admin\n"
WAIT ">"
DELAY 3
SEND "reboot\n"
WAIT "I am a router"
It's possible that the router likes to keep the connection open as it's rebooting.
RouterTech Team and Founding Member
Image
RouterTech Merchandise (UK)
No support via PM, please ask your questions on the forum!
ivanmil
Newbie
Newbie
Posts: 4
Joined: Fri Mar 14, 2008 9:37 am

Post by ivanmil » Fri Mar 14, 2008 4:30 pm

That worked! Thank you so much. Finally, after the whole day of trying and trying... Again, thanks. :D
bkejji
Newbie
Newbie
Posts: 6
Joined: Fri Oct 19, 2007 10:41 pm

Post by bkejji » Sat Mar 15, 2008 2:45 pm

thanx a lot for those Tips.
User avatar
Neo
RouterTech Team
RouterTech Team
Posts: 3586
Joined: Thu Jan 26, 2006 1:09 pm
Contact:

Post by Neo » Sat Mar 15, 2008 2:52 pm

ivanmil wrote:That worked! Thank you so much. Finally, after the whole day of trying and trying... Again, thanks. :D
I'm pleased it's working for you :D - you're very welcome ;)
bkejji wrote:thanx a lot for those Tips.
You're welcome :)
RouterTech Team and Founding Member
Image
RouterTech Merchandise (UK)
No support via PM, please ask your questions on the forum!
vadamp
Newbie
Newbie
Posts: 1
Joined: Sun Jun 29, 2008 4:14 pm

Post by vadamp » Sun Jun 29, 2008 4:32 pm

Hi, I'm having a problem with ts.exe... Since I installed SP3 it can not even be run. When I click on ts.exe nothing happens except that I hear the strange sound (for example when its runtime error), and I think that is the problem why I can not use the script files .vbs or .bat file. Can you help me somehow? I was also in contact with Ivanmil because we're from the same country but he doesn't know the solution... Thanks in advance.

This picture shows what I'm getting now when starting the ts.exe.
Attachments
untitled.JPG
(11.2 KiB) Downloaded 1135 times
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Post by thechief » Sun Jun 29, 2008 5:44 pm

Find a recent copy of the mswinsck.ocx file, install it to the Windows directory, and run "regsvr32 mswinsck.ocx".
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
mig
Newbie
Newbie
Posts: 1
Joined: Thu Feb 24, 2011 8:46 pm

Re: Telnet Scripter Problem

Post by mig » Thu Feb 24, 2011 8:50 pm

Hello,

I've wrote simply script but it doesn't work - it looks like it wait for the password:

my script:
HOST 192.168.1.34 23
WAIT "Login:"
SEND "admin\n"
WAIT "Password:"
SEND "dupa\n"
WAIT ">"
SEND "adsl start\n"
WAIT ">"
SEND "logout\n"

the output from ts is:
Checking script (clearing output file)
Running script
Opening connection
˙ý˙ý!˙ű˙ű

Login:

admin
Password:

(and nothing happens)

Could you help me fix this? I've tried some tricks (with delay for example), but it didn't work :(

regards
Monica1
Newbie
Newbie
Posts: 1
Joined: Mon Feb 06, 2012 3:06 am
Location: Switzerland

Re: Telnet Scripter Problem

Post by Monica1 » Tue Feb 07, 2012 12:02 pm

Hi,
This is my first day in this forum. I've read your post and really it looked very strange. If your task really must be done with telnet it could best be done with expect, otherwise use a login method which does not need interactive logins such as rsh/rexec or preferably ssh.
Thanks.
I am an English girl and I am working in werbeplakat as a Designer.
Samet
Newbie
Newbie
Posts: 1
Joined: Wed May 28, 2014 7:49 pm

Re: Telnet Scripter Problem

Post by Samet » Wed May 28, 2014 7:55 pm

Hello every one
I think after 2 years I find answer: :D
this code is for users they stop in password level.

Code: Select all

192.168.1.1 23

WAIT "Password"
SEND "admin\m"
WAIT ">"
SEND "set reboot\m"
Old problem :twisted:
Post Reply