TutorialNov 28, 20267 min read

Bot Stops When Remote Desktop Is Minimized or Closed? 3 Fixes

A bot that clicks or reads the screen stops when you minimize Remote Desktop because the client stops drawing the session. Set RemoteDesktop_SuppressWhenMinimized to 2 on your PC, hand the session to the console with tscon before you leave, and use Autologon after restarts.

Short answer: when you minimize the Remote Desktop window, the client stops drawing the remote screen, so bots that click, type or read pixels find nothing and stall. Fix it on the PC you connect from with the registry value RemoteDesktop_SuppressWhenMinimized set to 2, and when you want to close the window, hand the session to the server's console with tscon first so the desktop stays drawn.

The bot's process never stopped: Task Manager shows it running. What stopped is the screen it works on. This guide covers the three cases (minimized, closed, after a restart), with the commands for each, on a Windows Server RDP.

01Which Case Do You Have?

What you didWhat happens to programsWhat happens to the screenFix
Minimized the Remote Desktop windowKeep runningClient stops drawing itFix 1: registry value on your PC
Closed the window (X)Keep runningSession has no screenFix 2: tscon to the console
Server restarted (updates, dashboard)Stop, nobody signed inLogin screen onlyFix 3: Autologon and Startup folder
Signed out in WindowsClosedNoneDon't sign out; close or use Fix 2

02Which Bots Are Affected?

Only bots that need the visible screen: image search and pixel checks (AutoHotkey ImageSearch and PixelGetColor, pyautogui, SikuliX), simulated mouse clicks and key presses, OCR on a game window, and screen recording. They fail with "image not found", click into nothing, or freeze until you open the window again.

Bots that talk to an API, run a headless browser, or drive a program through its own interface (MetaTrader Expert Advisors, headless Selenium and Playwright, Telegram bots) keep working with the window minimized or closed. If that's yours, the problem is somewhere else: see Remote Desktop disconnects after login.

03Fix 1: Keep the Screen Drawn While Minimized

Remote Desktop Connection on Windows (mstsc) skips drawing a minimized session to save resources. One registry value turns that off. Set it on the computer you connect from, not on the server (Telerik's test automation docs describe the same value, read on 28 November 2026).

  1. 1Close every Remote Desktop window on your PC.
  2. 2Open Command Prompt on your PC. For the current user, run the first command. To set it for every user, run the other two in a Command Prompt opened as administrator.
  3. 3Connect again and minimize the window. The bot keeps finding the screen.
shell
reg add "HKCU\Software\Microsoft\Terminal Server Client" /v RemoteDesktop_SuppressWhenMinimized /t REG_DWORD /d 2 /f
shell
reg add "HKLM\Software\Microsoft\Terminal Server Client" /v RemoteDesktop_SuppressWhenMinimized /t REG_DWORD /d 2 /f
reg add "HKLM\Software\Wow6432Node\Microsoft\Terminal Server Client" /v RemoteDesktop_SuppressWhenMinimized /t REG_DWORD /d 2 /f

To undo it, delete the value: reg delete "HKCU\Software\Microsoft\Terminal Server Client" /v RemoteDesktop_SuppressWhenMinimized /f.

Your PC still has to stay on with the window open. To switch it off, you need Fix 2.

04Fix 2: Close Remote Desktop Without Losing the Screen

When you close the window, the session keeps running but has no display. tscon can hand your session to the server's console, the screen the server has even with nobody connected. Remote Desktop closes, and your desktop stays drawn there.

Find your session ID and move it, in a Command Prompt on the server opened as administrator:

shell
query user
tscon 2 /dest:console

query user lists your session with its ID (here 2). The Remote Desktop window closes right after tscon. That is expected.

For one double click, save this as to-console.bat on the server's desktop, then right click it and choose Run as administrator each time you leave:

shell
@echo off
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
  %windir%\System32\tscon.exe %%s /dest:console
)

The console has its own screen size, which can differ from your Remote Desktop window. Bots that click at fixed coordinates or match images of a certain size should be checked once after the switch. Set the resolution the bot expects in Settings, System, Display while you're on the console.

05Fix 3: Bots That Survive a Restart

After Windows Update or a restart from the dashboard, nobody is signed in, so bots that need a desktop never start. Two pieces fix it.

  1. 1Sign in by itself. Microsoft's free Autologon tool sets Windows to sign in a user at the console after every start. Run it on the server, enter the username, the computer name and the password, and press Enable.
  2. 2Start the bots at sign-in. Press Win+R, type shell:startup and put shortcuts to your bots in that folder. They start when the automatic sign-in finishes, on a drawn console screen.
  3. 3Restart once to test it. Restart from the dashboard, wait two minutes, and check that the bots are running without you connecting. When you do connect, you take over that console session.

Autologon stores the password encrypted in the registry, but Microsoft notes that anyone with administrator rights on the server can read it back. Use a long, unique password and limit Remote Desktop to your own IP on the firewall card. More hardening steps: secure a Windows RDP server.

06What Else Stops a Screen Bot?

A lock screen

If the bot finds a login screen after a while, open Screen saver settings in Control Panel and untick "On resume, display logon screen".

A second login

Connecting from another device with the same account takes the session over and can change its screen size. Use one device, or a second Windows user for a second person.

Windows Update restarts

Set active hours in Windows Update so restarts happen when you choose, and rely on Fix 3 for the rest.

Memory

A server that runs out of RAM freezes windows first. Count 1 to 2 GB per game client or browser (RAM per bot).

07Which Server Size Runs Screen Bots?

PlanvCPURAMDiskPer monthFits
Windows RDP26 GB40 GB NVMe$13.002 to 4 light bots with a browser or older game client
Windows RDP48 GB60 GB NVMe$26.004 to 6 light bots
Windows RDP812 GB80 GB NVMe$45.50Heavier clients, more bots
Windows RDP1036 GB140 GB NVMe$104.00Many clients at once

Every plan is Windows Server 2019, 2022 or 2025 with Administrator access and the licence included, in Amsterdam, Frankfurt, Warsaw, Romania, New York or Hong Kong at the same price, ready 10 to 20 minutes after the payment confirms. There is no GPU, so games run with software rendering.

The Remote Desktop client stops drawing a minimized session, so bots that click or read the screen find nothing. Set the DWORD RemoteDesktop_SuppressWhenMinimized to 2 under HKCU\Software\Microsoft\Terminal Server Client on the PC you connect from, then reconnect.

  • rdp minimized bot stops
  • remote desktop minimized automation
  • RemoteDesktop_SuppressWhenMinimized
  • tscon console
  • keep rdp session active
  • bot stops when rdp closed
  • pyautogui rdp minimized

Keep reading

All articles