Monday, April 09, 2012

Restore display to console after Windows Remote Desktop session

On a recent project, we were given a Windows computer hooked up to a big screen TV to use as a highly-visible build-status/metrics radiator display. The keyboard and mouse were intentionally removed so that passers-by can't easily mess with the display.

To make changes to how things looked, we simply used Windows Remote Desktop (mstsc) to log in. However, when you disconnect, the TV screen remains in the locked state. This isn't what we wanted - we wanted the screen to show what we saw in our Remote Desktop session.

A web search revealed how to accomplish this, but I thought I'd post quick instructions here for reference (for Windows 7):
  1. Identify your session ID
    1. I find it's just as easy to bring up the Task Manager (shortcut: Ctrl-Shift-Esc), look at the Users tab, and identify your ID (let's say it is ID 2).
  2. Create a batch file (eg. restore-console-display.bat) with the contents:
    tscon.exe 2 /dest:console /v
  3. Basically, you want to run this as Administrator each time to restore the display back to the console. I simply placed a shortcut to this batch file in my Start menu, then made it request admin priviledges when it runs:
    1. Properties (of the shortcut)
    2. Advanced (button on the Shortcut tab)
    3. Run as administrator (checkbox)
Side-note: A Windows machine may not be your first choice for a build radiator display, but in many Windows-based corporate environments, such a workstation may be the quickest asset to procure.