Jump to content
Sign in to follow this  
ChevChelioS

How to cmd telnet connection?

Recommended Posts

Jos

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                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
orbs

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
ChevChelioS

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
Jos

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                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Jos

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                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
ChevChelioS

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
orbs

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
Exit

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
hydranix

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
Jos

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                                How to post scriptsource        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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.