ChevChelioS Posted February 28, 2015 Posted February 28, 2015 hello friends RunWait(@COMSPEC & " /c " & pause"telnet 192.168.2.1", @SW_SHOW) let alone get cmd screen admin and password after reboot?
jaberwacky Posted February 28, 2015 Posted February 28, 2015 RunWait(@COMSPEC & " /c " & pause & " telnet 192.168.2.1", @SW_SHOW) You forgot an &. I don't know if that's the problem but it is a problem. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
Developers Jos Posted February 28, 2015 Developers Posted February 28, 2015 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.
orbs Posted February 28, 2015 Posted February 28, 2015 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
ChevChelioS Posted February 28, 2015 Author Posted February 28, 2015 (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 February 28, 2015 by ChevChelioS
Developers Jos Posted February 28, 2015 Developers Posted February 28, 2015 (edited) telnet connection That much I understand.. try explaining what you need to do as that is not totally clear! Edited February 28, 2015 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.
ChevChelioS Posted February 28, 2015 Author Posted February 28, 2015 I know I still did not autoıt $paus = "pause" RunWait(@COMSPEC & " /c " & $paus & " telnet 192.168.2.1", @SW_SHOW)
Developers Jos Posted February 28, 2015 Developers Posted February 28, 2015 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.
ChevChelioS Posted February 28, 2015 Author Posted February 28, 2015 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
orbs Posted February 28, 2015 Posted February 28, 2015 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
Exit Posted March 1, 2015 Posted March 1, 2015 (edited) So you just want to reboot your router? If YES then show us model and type. Edited March 1, 2015 by Exit App: Au3toCmd UDF: _SingleScript()
hydranix Posted March 1, 2015 Posted March 1, 2015 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.
Developers Jos Posted March 1, 2015 Developers Posted March 1, 2015 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now