Jump to content

Using Send function on a remote server


sanmeet
 Share

Recommended Posts

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

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

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
Link to comment
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");

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

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...