Created
October 7, 2023 12:28
-
-
Save katrinafyi/243a6fc6ca7673a09b64ca0232cc220d to your computer and use it in GitHub Desktop.
disconnects a RDP session and connects it back to the local computer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: https://superuser.com/questions/355935/how-can-i-restore-a-remote-desktop-session-to-the-local-console | |
for /f %%i in ('qwinsta ^| findstr /C:">rdp-tcp#"') do set RDP_SESSION=%%i | |
:: Strip the > | |
set RDP_SESSION=%RDP_SESSION:>=% | |
tscon %RDP_SESSION% /dest:console |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment