I got tired of logging in again every time I returned to my PC after using it through RDP, so I built a tiny Windows helper that switches the remote session back to the physical one using the real screen, keyboard, and mouse.
- Runs
tsconagainst your current user session to attach it to the physical session - Wraps the action in a scheduled task so it works from any shell (RDP, SSH, WinRM, etc.) and with the right privileges
- One command:
rtcreconnects your RDP session to the physical display - Installer adds a single
binfolder to your user PATH (HKCU) and creates thertctask - Smart pre checks: installer skips if already installed; uninstaller skips if not installed
rtccloses the launching CMD window on success (returns an error otherwise)
- Windows 10/11 or Windows Server with RDP enabled
- PowerShell 5.1 (inbox on Windows 10/11)
- Permission to manage your own sessions
- Choose where you want this tool to live permanently and clone or copy the repository there. The installer adds that folder’s
binsubdirectory to your user PATH and the uninstall will remove that same path. If you move the folder later, rununinstall.batand then reinstall from the new location. - Run
install.bat(no need to pre elevate; it will prompt for UAC). - If already installed (PATH contains the tool and the
rtctask exists) you’ll be told and nothing changes.
- From any shell:
rtc - If started from a CMD window, it triggers the task and closes that window on success.
- If the task cannot be started, it prints a short error and leaves your shell open.
- Run
uninstall.bat(prompts for UAC). - If not installed, you’ll be told and nothing changes.
-
ReconnectToConsole.bat(root):query user %USERNAME%to get your session IDtscon <id> /dest:consoleto attach the session to the physical display
-
bin/rtc.bat:- Runs
schtasks /run /tn rtcquietly - Exits on success so interactive CMD windows close
- Runs
-
install.bat:- Elevates via UAC, resolves the canonical install path
- Adds the
binfolder to HKCU PATH (dedupes existing entries) - Registers a manual "On demand" task named
rtcthat runscmd.exe /c "ReconnectToConsole.bat" - Uses Highest privileges and compatibility set to
Win8(highest value exposed by the PowerShell ScheduledTasks module on Windows 10/11) - Skips work and reports "already installed" when appropriate
-
uninstall.bat:- Elevates via UAC
- Removes the
binentry from HKCU PATH and from the current session - Deletes the
rtctask - Skips work and reports "not installed" when appropriate
-
“Access is denied” or elevation prompts keep appearing
- Accept the UAC prompt, or start an elevated Command Prompt first
-
rtcnot found after install- Open a new shell, or run
set PATHand confirm thebinfolder is present
- Open a new shell, or run
-
Task runs but nothing moves
- Make sure you are in an RDP session; verify with
query user
- Make sure you are in an RDP session; verify with
This project is licensed under the MIT License.
See the LICENSE file for details.