Created
December 30, 2023 06:30
-
-
Save cybersholt/e818316d2253e5d0b477b2dde786d0a5 to your computer and use it in GitHub Desktop.
RDP Keep Session Active + fix DPI issue
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
@echo off | |
:: Get current user's session ID | |
for /f "tokens=1,2,3 delims= " %%i in ('query session ^| findstr "%USERNAME%"') do set SessionId=%%k | |
:: Reconnect the session to the console | |
Tscon %SessionId% /Dest:console | |
:: Restart Windows Explorer | |
taskkill /f /im explorer.exe | |
start explorer.exe | |
:: Load a predefined DisplayFusion Monitor Profile | |
"C:\Program Files (x86)\DisplayFusion\DisplayFusionCommand.exe" -monitorloadprofile "default_with_90_right" | |
:: Optional: Add additional commands if needed | |
:: End of script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment