Jump to content
Sign in to follow this  

ControlSetText in Remote Desktop Session

Recommended Posts


I have found that when an autoit script is running in a windows 2003 remote desktop session then the ControlSetText function does not work in some cases. The sample script from the help for the functiom to set text in a notepad window works correctly. However when i try to set text in the Filename field of a standard windows file open dialog, then the function does not work, unless the Open window has the focus. This problem does not occur in a normal (i.e. non-remote session). After trying different things i found that the _GUICtrlEdit_SetText works as expected.

The reason I needed the code to work in all cases is because it needs to run when no one is logged on or If i am logged on remotely.

This does not work:

ControlSetText("Open", "", "[CLASS:Edit; INSTANCE:1]", "some text")

This does work:

$handle = ControlGetHandle("Open", "", "[CLASS:Edit; INSTANCE:1]")
_GUICtrlEdit_SetText($handle, "some text")

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.