Jump to content

Recommended Posts

Posted

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.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

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
Posted

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

Posted

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.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...