Help centerWindows
Why does my bot stop when I minimize Remote Desktop?
1 min read|Updated Nov 28, 2026
Short answer
The Remote Desktop client stops drawing a minimized session, so bots that click or read the screen find nothing. Set RemoteDesktop_SuppressWhenMinimized to 2 on the PC you connect from, or hand the session to the console with tscon before you close the window.
The bot is still running on the server. Only the screen it works on stopped being drawn.
- 01
Close all Remote Desktop windows
on your own PC.
- 02
Set the registry value on your PC
, not on the server. In Command Prompt:
reg add "HKCU\Software\Microsoft\Terminal Server Client" /v RemoteDesktop_SuppressWhenMinimized /t REG_DWORD /d 2 /f - 03
Connect again and minimize
The bot keeps finding the screen.
- 04
Want to close the window or switch off your PC?
On the server, in Command Prompt as administrator, run
query userto see your session ID, thentscon 2 /dest:consolewith that ID. The window closes and the desktop stays drawn on the server.
Bots that use an API or a headless browser, and MetaTrader Expert Advisors, don't need this.
Did this solve it?
The full guide
Bot Stops When Remote Desktop Is Minimized or Closed? 3 Fixes
7 min read