Mouse/keyboard interaction not working in remote desktop

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
rnoecker
Junior Coder
Posts: 25
Joined: Fri Jun 07, 2013 4:44 pm

Mouse/keyboard interaction not working in remote desktop

Post by rnoecker » Wed Jun 19, 2013 7:58 pm

I have a test script which opens up notepad and uses the send command to enter text (Send>This is a test). The text is not appearing unless I have the remote desktop window open and active.

I did some searches through the forum and site and read up on how a remote desktop session is locked when you disconnect or even minimize it, however, it seems like what I am trying to do should work when using the autologon functionality to simulate a user logging into a locked and disconnected remote session. Autologon seems to not work if I completely log off so I am locking the session and then disconnecting. The script runs in this scenario, and when I log back in I can see that it has opened notepad, but there is no text. I'm assuming autologon is working since it is able to open up notepad, but if that assumption is incorrect it may be that autologon is not working which is preventing it from accessing the mouse and keyboard.

I am using a Windows 7 virtual machine so I don't know if it is possible to remotely connect to the console (as you can do in Windows 2003), but I assume the remote session and the console are the same since you can only be logged in using either method at a time and the desktop is the same across both if you use the same username to login.

One thing I have found is that it works if I use the following command to connect the remote session to the console (which also logs off the remote session). The macro is then able to interact with the mouse and keyboard, and I'm not sure why this is. It may be that I am wrong in thinking it should work, or there may be an issue with using a virtual machine which never has a user logging into the console.

tscon.exe sessionid /dest:console

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jun 20, 2013 8:24 am

AutoLogon doesn't work inside a remote desktop/terminal services session.

http://www.mjtnet.com/autologon.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts