Skip to content

Instantly share code, notes, and snippets.

@iarp
Created July 2, 2017 00:00
Show Gist options
  • Save iarp/816b75cc6f7eb61ae4dc0b755a2f1404 to your computer and use it in GitHub Desktop.
Save iarp/816b75cc6f7eb61ae4dc0b755a2f1404 to your computer and use it in GitHub Desktop.
Disconnect RDP from a Windows machine, sending the system back to console so that LogMeIn Hamachi doesn't go offline.
# This script locks the server, disconnects you from the servers RDP session
# sending the session back to console so hamachi does not get disconnected
tscon 0 /dest:console
tscon 1 /dest:console
tscon 2 /dest:console
Rundll32.exe User32.dll,LockWorkStation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment