Jump to content

How to cmd telnet connection?


Recommended Posts

  • Developers

So what is it you want to do?

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

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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.

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

 

Link to comment
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

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
Link to comment
Share on other sites

  • Developers

telnet connection

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

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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.

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

 

Link to comment
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.

Link to comment
Share on other sites

  • Developers

The AutoIt community is hostile to newbs today.

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

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

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