WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Sending Keystrokes

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Remote Desktop and WinBatch


Question:

I have an application that I am running on a remote desktop. After I launch the application I minimize the remote desktop connection, but the application stops. Has this happened to anyone else?

Question (more):

Yes, I just discovered this happening to me. In my case I am running a WB script on a VM that I access with Remote Desktop. This script is sending keystrokes. I made it loop until the window actually received the keystrokes. This doesn't happen until I open the display.

Answer:

It is very likely that minimizing the remote desktop client is equivalent to putting the remote session into a disconnected state, which is functionally the same as locking the local workstation in terms of how the SendKey*() functions work. Which is to say, the SendKey*() functions *don't* work when the desktop session is locked or disconnected. This happens due to the fact that a desktop session one of those states does not have a logical keyboard associated with it so there's no way for simulated keystrokes to be sent.

Instead, you need to make use of the Control Manager extender to directly manipulate controls in the application rather than relying on blind sending of keystrokes.


Alternative option: You might try to find a setting for your Remote Desktop server or client to keep connected even when minimized. One possible way to work around the issue, you can change the Remote Desktop’s registry settings on your local computer (where you launch the Remote Desktop):

Now when you minimize the Remote Desktop Connection window on your computer, this will not affect the remote computer’s GUI and the GUI will be available to your automated tests.
Article ID:   W17259
File Created: 2014:01:23:10:46:52
Last Updated: 2014:01:23:10:46:52