# Your agent's clicks stop when you minimize Remote Desktop or lock the screen

> Source: <https://dev.to/autenai/your-agents-clicks-stop-when-you-minimize-remote-desktop-or-lock-the-screen-37g4>
> Published: 2026-11-03 05:50:31+00:00

Your agent runs fine on a Windows box you reach over Remote Desktop. You start a long task, minimize the RDP window to do something else, and come back to a run that failed halfway: clicks returned "ok", keystrokes went nowhere, screenshots are black or stale. Or you closed the RDP window at the end of the day and every overnight run failed at its first click.

Nothing is wrong with the model or your MCP server. GUI automation needs a desktop that Windows is actually drawing, and both of those actions take it away.

In all three cases synthetic input does not raise an error. `SendInput` style calls simply have no live desktop to deliver to, which is why the tool reports success while nothing moves.

This is a setting on the computer you connect **from**, not on the remote one.

`regedit`, open `HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client` (or the same path under `HKEY_LOCAL_MACHINE` for all users).`RemoteDesktop_SuppressWhenMinimized` with value `2`.`...\Software\Wow6432Node\Microsoft\Terminal Server Client` as well.
Or in one line from a normal PowerShell:

```
New-ItemProperty -Path "HKCU:\Software\Microsoft\Terminal Server Client" `
  -Name RemoteDesktop_SuppressWhenMinimized -PropertyType DWord -Value 2 -Force
```

Reconnect, and minimizing no longer takes the remote GUI away. SmartBear notes one known side effect: it can break screen sharing in Microsoft Lync.

Closing the RDP window locks the session. Instead, hand the session back to the remote computer's console. Run this **on the remote computer**, inside the RDP session, as Administrator:

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

(In a `.bat` file, double the percent signs: `%%s`.) Your RDP client closes with "Your Remote Desktop Services session has ended", and the desktop stays unlocked and drawn on the remote machine, so the agent keeps working.

Two things to know:

`Rundll32.exe user32.dll,LockWorkStation`), never while a GUI run is still going.
A VNC server shows the machine's real console instead of a separate virtual session. Minimizing or disconnecting a VNC client does not destroy the active desktop by default, and the same approach works on macOS (Screen Sharing is VNC) and Linux. The pywinauto remote execution guide recommends this as the simpler route. Mixing RDP and VNC on the same box brings the RDP problems back, so pick one.

**A locked screen.** If the machine locks, from an idle timeout or a policy, the input goes to the secure logon desktop, which no ordinary process can drive. That is by design. For unattended runs, set the idle lock and sleep timeouts on that machine so they do not fire mid-run, if your security policy allows it, and run on a box nobody else can walk up to.

`RemoteDesktop_SuppressWhenMinimized = 2` on your local computer.`tscon ... /dest:console`, not the X button.
We build Auten, an MCP server that gives Claude Code, Codex, Cursor or any MCP client hands on a real screen: your computer (Mac, Windows, Linux) and your Android phone (beta). It runs on the machine whose screen it controls, so it needs a live, unlocked desktop exactly like every other tool here. Setup is at [auten.ai/mcp](https://auten.ai/mcp?utm_source=devto&utm_medium=social).

If you run agents on remote Windows machines and hit a case these three fixes did not cover, describe it in the comments. We collect these.
