Skip to content

Instantly share code, notes, and snippets.

@Nora-Ballard
Created February 15, 2014 14:14
Show Gist options
  • Select an option

  • Save Nora-Ballard/9019804 to your computer and use it in GitHub Desktop.

Select an option

Save Nora-Ballard/9019804 to your computer and use it in GitHub Desktop.
Moves the active RDP session of the specified user to the physical console, the session remains unlocked. This allows one to leave the physical console unlocked after using RDP. Great for Media Center PC or Nvidia/Steam Game Streaming. See https://serverfault.com/questions/428975/how-to-use-tscon-on-windows7
@ECHO OFF
if "%1" == "" goto error
for /f "skip=1 tokens=3 usebackq" %%s in (
`query user %1%`
) do (
echo Setting %%s to console.
%windir%\System32\tscon.exe %%s /dest:console
)
goto end
:error
echo missing argument!
:end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment