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 Connections and WinBatch


Question:

When I "Disconnect" (not Logoff) from a Remote Desktop Connection in Windows XP, the WinBatch programs do not seem to work on the remote computer if they are scheduled to run. They may be having trouble finding windows. Is there a way to "Disconnect" from a RDC and still have scheduled WinBatch programs work? I am running version 2005C of WinBatch.

Answer:

You're getting into a very murky area there. Can you provide more detail about what your scripts are actually supposed to be doing?

In general, when you disconnect from a RDC session, the session is treated like a workstation that has been locked, and it's identical in nature to any other terminal services session that has been disconnected or locked. The primary issue is that in this state, the session doesn't have a logical keyboard or mouse and has no means of user input. In such a state, all of the SendKey*() functions and the other functions that make mouse movements, mouse clicks and menu selections are disabled. Likewise, if you're script displays any message boxes that need to be ACK'd, the message boxes will simply sit there in a state where they can never receive input and so your script will hang.

Finally, if the Windows Task Scheduler is used to launch the scripts, they may actually run in a session that doesn't contain the desktop where target windows may be assumed to exist. As such the run-time environment that the script is executing in may be inappropriate and the script may break.


Article ID:   W17260
File Created: 2007:07:03:14:29:04
Last Updated: 2007:07:03:14:29:04