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.

  1. 01

    Close all Remote Desktop windows

    on your own PC.

  2. 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

  3. 03

    Connect again and minimize

    The bot keeps finding the screen.

  4. 04

    Want to close the window or switch off your PC?

    On the server, in Command Prompt as administrator, run query user to see your session ID, then tscon 2 /dest:console with 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

Related questions

Still stuck? Message support