Skip to content

Instantly share code, notes, and snippets.

@darrenpmeyer
Last active May 2, 2017 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenpmeyer/2577db0ca08b695549e4 to your computer and use it in GitHub Desktop.
Save darrenpmeyer/2577db0ca08b695549e4 to your computer and use it in GitHub Desktop.
Shortcut (Run as Administrator!) to disconnect RDP and stay logged in on console
@ECHO OFF
%CSIDL_SYSTEM%\tscon.exe %sessionname% /dest:console
REM - run this as Administrator (or it won't work properly!)
REM
REM - disconnecting from RDP usually locks the console. If you don't want that,
REM - such as when running a headless Steam game server, then use this to end
REM - your sessions instead.
REM
REM - note that it can take up to 30s to disconnect this way, such is life.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment