• Preventing lock screen from appearing after you’ve remoted into a host through Remote Desktop

    by  • January 12, 2009 • htpc, remote desktop • 1 Comment

    I’ve been trying to perfect my HTPC setup recently, the latest addition being a Logitech Harmony 555 remote which lets me control all my devices from one remote control. It’s based on activities like ‘Watch Sky’,‘Play XBOX 360’ and ‘HTPC’ and switches the appropriate inputs on my TV, amp, and other devices, and assigns the volume control to the amp rather than the TV which is great. I’m also using a free utility, Human Interface Programmer, on the HTPC, which allows you to assign custom commands to remote control presses based on application profiles, and works with the Media Center remote and receiver. By default it emulates the media center keypresses when it detects the media center app being started, but I’ve also set up one to work with media player classic so the aim is to control everything from the remote, even mouse movements.

    I remote in pretty regularly to the HTPC to initiate large file transfers and it’s always a pain when I come to watching anything on the HTPC that I have to re-enter my password after having accessed it remotely as it locks the host session, difficult without a keyboard/mouse. I wondered if there was a way this could be avoided, so when I disconnect from the remote session, the host session becomes active once more (back to the desktop). Found a great forum post on Soft32 at http://forum.soft32.com/windows/Return-console-screen-disconnecting-RDP-ftopict375304.html that explains the necessary steps.

    You need to use the tscon.exe command line utility in the following manner:

    tscon 0 /dest:console

    This will disconnect the remote session and unlock the existing session on the host and is exactly the behaviour I needed. You cannot automate it any further, for example, when you press the Disconnect, or close the remote session’s window, but I’ve created a shortcut on the desktop which runs tscon as above and it works great. Probably not recommended if you are remoting into a machine you don’t have physical access to afterwards, as it will leave the machine in an unlocked state, but this is fine for the HTPC.

    About

    .NET developer at thetrainline.com, previously web developer at MRM Meteorite. Awarded a PhD in misbehaviour detection in wireless ad-hoc networks.A keen C# ASP.net developer bridging the gap with APIs and JavaScript frameworks, one web app at a time.

    http://www.paulkiddie.com

    One Response to Preventing lock screen from appearing after you’ve remoted into a host through Remote Desktop

    1. Eugen
      June 9, 2011 at 3:42 pm

      Great! Just what I’ve been looking for…

    Leave a Reply

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