Sign in to follow this  
Followers 0
tiger223

Controlsettext Help

10 posts in this topic

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

Share this post


Link to post
Share on other sites



Try ControlSend.

Share this post


Link to post
Share on other sites

have you tried using autoit windows spy to find the names of the controls on the window u are sendign the text to?


Triton

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Yes Triton, i have used autoit windows spy and it didnt display the classname in the telnet dos window.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 ( ) ?

Share this post


Link to post
Share on other sites

#10 ·  Posted (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 by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

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  
Followers 0