Sign in to follow this  
Followers 0
sanmeet

Using Send function on a remote server

7 posts in this topic

I have developed a script using AutoIt and would like it to run daily on a server. But my script is not sending keys when I use SEND Function unless I am logged on to a sever. Any advice how can I run my script without logging on to a server.

Thanks

Share this post


Link to post
Share on other sites



I think Send only works on the active window and since you're logged off it won't do much. You have to use ControlSend().

Share this post


Link to post
Share on other sites

I think Send only works on the active window and since you're logged off it won't do much. You have to use ControlSend().

Thanks for the quick reply... let me give it a try

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I think Send only works on the active window and since you're logged off it won't do much. You have to use ControlSend().

I just tried ControlSend function and it did not work for me. Here is my code: -

Run ("J:\fltctrl\bin\MxtCtrl.exe") ; to open my program

WinWaitActive("Log In - Maintenance Control", "")

ControlSend("Log In - Maintenance Control", "", "TEdit2", "username");

ControlSend("Log In - Maintenance Control", "", "TEdit1", "password")

Edited by sanmeet

Share this post


Link to post
Share on other sites

You should test to see if you can get a handle to those controls first then.

$handle = ControlGetHandle ("Log In - Maintenance Control", "", "TEdit2")

If @error Then MsgBox(0,"","ERROR")

If there is no error you can use that handle variable to do the ControlSend()

ControlSend("Log In - Maintenance Control", "", $handle, "username");

Share this post


Link to post
Share on other sites

You should test to see if you can get a handle to those controls first then.

$handle = ControlGetHandle ("Log In - Maintenance Control", "", "TEdit2")

If @error Then MsgBox(0,"","ERROR")

If there is no error you can use that handle variable to do the ControlSend()

ControlSend("Log In - Maintenance Control", "", $handle, "username");

I tried your suggestion and still not working....any other suggestions?

Share this post


Link to post
Share on other sites

Did the ControlGetHandle show an error?

Maybe in this case try ControlSetText()

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