Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Virtual Machine VM VMWare Remote Desktop Send Keystroke SendKey SendKeysTo Mouse MouseMove Mouse Click Locked Console Disconnected RDP Session
The strang thing is that I have another client where we are running Winbatch similarly disconnected and Winbatch does respond to SendKey(). The obvious question is what is different between the two clients.
However, you can shadow (remote attach) to an existing console session and then detach from it. When you do this, the console session's Default desktop processes will still receive user input after the detach until the session switches to a different desktop like the screen saver/Winlogon desktop or is shutdown by logging off. The physical system console session can remain in an unlocked state, and while unlocked, the SendKey*() and Mouse*() functions will work properly. This might explain why it works for one client and not another.
There is absolutely no ambiguity involved with how these functions behave w/respect to unlocked sessions and locked/disconnected sessions. The only variable involved is what state the session is actually in at any given time, which may not be obvious and is implied by how these functions are behaving at any given time. If the script will be running in a session that has any possibility of going into a locked or disconnected state, then the script needs to be rewritten to not use the SendKey*(), Mouse*() or any other functions that do not function in a locked/disconnected session. Again, the script will need to be rewritten to work in a different manner, possibly using the Control Manager extender or COM/OLE.
Article ID: W18275
Filename: Virtual Machine and SendKey.txt
File Created: 2013:06:27:08:47:30
Last Updated: 2013:06:27:08:47:30