Sign in to follow this  
Followers 0
ChevChelioS

How to cmd telnet connection?

15 posts in this topic




There is an error  :(

i7lBzmo.jpg

Share this post


Link to post
Share on other sites

So what is it you want to do?

What would be the commandline when you type it yourself in the CMD window?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

There is an error  :(

 

this is a syntax error. you can see it for yourself by the colouring. the word "pause" is in gray, meaning AutoIt expects it to be a variable or a function - which is neither. this will be easily resolved when you answer Jos's question above.

also, telnet is an independent executable. you do not need to run it via @comspec (unless you need some special shell operations, like output redirection and such). remove the @comspec reference, and you'll be on a much more stable ground for troubleshooting.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

So what is it you want to do?

What would be the commandline when you type it yourself in the CMD window?

 

Jos

telnet connection

 

also, telnet is an independent executable. you do not need to run it via @comspec (unless you need some special shell operations, like output redirection and such). remove the @comspec reference, and you'll be on a much more stable ground for troubleshooting.

How will

Edited by ChevChelioS

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

telnet connection

That much I understand..  try explaining what you need to do as that is not totally clear!

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Ok last try by me:

  • Please explain what you want to do with this command?
  • The pause in that command does not make sense!

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Ok last try by me:

  • Please explain what you want to do with this command?
  • The pause in that command does not make sense!

Jos

ok

run cmd

telnet

open 192.168.2.1

Air5443 login: root

password:admin

reboot

quit

Share this post


Link to post
Share on other sites

ChevChelioS,

considering your apparent lack of technical communication skills, your lack of knowledge in scripting (in general) and in AutoIt (in specific), and considering the task at hand, i think you should use a more appropriate tool to automate your telnet session. for example, this.

Share this post


Link to post
Share on other sites

orbs I want to  AutoIt please..

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

So you just want to reboot your router?

If YES then show us model and type.

Edited by Exit

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites

The AutoIt community is hostile to newbs today.

Maybe I can help.

What you're trying to accomplish obviously cannot be done with the limitations of batch scripting due to the need to login. Or so it seems.

Note: the router model is in his post. It is an Air5443...

The autoit script to accomplish such a task would be something like the following.

#NoTrayIcon
Run(@Comspec)
WinWait("[CLASS:ConsoleWindowClass]")
WinActivate("[CLASS:ConsoleWindowClass]")
WinWaitActive("[CLASS:ConsoleWindowClass]")
Send("telnet 192.169.2.1{enter}")
Sleep(3000)
Send("root{enter}")
Sleep(2000)
Send("admin{enter}")
Sleep(2000)
Send("reboot{enter}")
Sleep(3000)
Send("quit{enter}")
WinClose("[CLASS:ConsoleWindowClass]")

As stated, there are far better tools for the job.

Its likely your modem/router has a built in cgi function that will reboot it, and using autoit's IE scripting might be far more reliable than my script which i wrote in less than 30 seconds with no promises of it actually working or not. Though i believe it will, albeit a rather brute-force method.

Share this post


Link to post
Share on other sites

The AutoIt community is hostile to newbs today.

Excuse me ....  I think you can't be more wrong but "whatever".

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0