tiger223 Posted March 26, 2004 Posted March 26, 2004 ControlSetText("Telnet", "", "Edit1", "login pass" ) I need some help with the code above, i wanted to use the ControlSetText to automatically login to my telnet account, but for some reason it wont send the text. Since Send() function interupts with other instances of windows i attempted to use this method. Any help would be appreciated. Thanks
Triton Posted March 26, 2004 Posted March 26, 2004 have you tried using autoit windows spy to find the names of the controls on the window u are sendign the text to? Triton
tiger223 Posted March 26, 2004 Author Posted March 26, 2004 I have recently tried ControlSend as well: ControlSend("Telnet", "", "Edit1", "login pass") The window "Telnet" is correct, but im not sure about the Class "Edit1" , although it still doesn't work. Any further suggestions? Thanks.
tiger223 Posted March 26, 2004 Author Posted March 26, 2004 Yes Triton, i have used autoit windows spy and it didnt display the classname in the telnet dos window.
Batch Posted March 26, 2004 Posted March 26, 2004 The window spy should tell you the control. Put your cursor over the box you put your password in and hit Ctrl+Alt+F to freeze the Window Spy, then you can copy the name of the "last control under mouse" into your script. I just wrote a script 5 minutes ago to automate my login to our tech support software here and I used "ControlSend" to do it.
tiger223 Posted March 26, 2004 Author Posted March 26, 2004 Batch, there is no box to type the password, it just types the password through dos. Like typing netstat in cmd.exe, I don't get any Last Control Under Mouse when i place my cursor there.
Valik Posted March 26, 2004 Posted March 26, 2004 Control functions don't work with DOS windows. And, if you see no control in any window (Meaning, not just DOS), then a control function can't be used.
tiger223 Posted March 26, 2004 Author Posted March 26, 2004 Ah, Valik thanks. I was thinking of that but wasn't sure. Are there any other ways to send text to a dos window without interference such as the ones caused by Send ( ) ?
scriptkitty Posted March 26, 2004 Posted March 26, 2004 (edited) test this for dos windows: Run("cmd") ProcessWait ("cmd.exe") winactivate("C:\") send("dir{enter}") Control don't work so good, but if you have active windows, send works fine. this seems to work on XP well enough ControlSend("C:\","","","dir{enter}") edit, or more specifially Run("cmd") ProcessWait ("cmd.exe") winactivate("C:\") ControlSend("C:\","","","dir{enter}") Edited March 26, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers.
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