How to keep Windows local desktop open

By | October 2, 2015

To run Windows UI automation, the machine has to be in unlock state. However, the test machine may be located in a data center, a cloud, or a locked lab. Remote desktop is the best way to acces it. What will happen when remote desktop is disconnected? Windows’s local console is locked. If UI automation is kicked off, it may not run as expected.

The solution is to use Task Scheduler. Create a new task with elevated privileges.

local desktop open 1

The trigger of the task is when a user disconnects a remote session.

local desktop open 2

The action to be taken is to run the command “tscon 1 /dest:console“, where 1 is the user ID. To find the user ID, go to Users tab in Task Manager.

local desktop open 3

Leave a Reply

Your email address will not be published. Required fields are marked *