0XC00A0006

Fix STATUS_CTX_CLOSE_PENDING (0xC00A0006) RDP Error

Network & Connectivity Intermediate 👁 1 views 📅 May 28, 2026

This RDP error means a terminal connection is stuck in a closing state. You'll need to kill the hung session or restart the service.

Yeah, that 0xC00A0006 error is annoying. You try to Remote Desktop into a machine, and instead of your desktop, you get that message about a close operation pending. It usually happens after a user logged off abruptly—power failure, network drop, or a forced shutdown. The terminal session is stuck in a weird half-closed state.

The Quick Fix: Kill the Hung Session via Command Line

You don't need a reboot for this. The fix is to force-close the stuck session using qwinsta and rwinsta. Here's the step-by-step.

  1. Open a Command Prompt as Administrator. Hit Windows Key + X, then click Command Prompt (Admin) or Windows PowerShell (Admin).
  2. Type qwinsta and press Enter. You'll see a list of all active sessions. Look for the one with the ID in the Session ID column. Usually the hung session shows a status like Disc or Active but the user's disconnected.
  3. Find the session ID for the user who's stuck. If you're the only one, it's probably session 1 (console is usually 0).
  4. Now type rwinsta <sessionID> (replace <sessionID> with the actual number, e.g., rwinsta 1) and press Enter.
  5. After running this, the session should be forcibly closed. You'll see no confirmation message—it just works.
  6. Now try connecting via RDP again. Open Remote Desktop Connection, enter the computer name, and connect. This time it should let you in.

What you should expect: After running rwinsta, the session disappears from the qwinsta list. Then your new RDP connection should succeed immediately.

If that still doesn't work, move to the next section.

Why This Works

The error 0xC00A0006 means the Terminal Services session manager (termdd.sys) has a session that's in the middle of closing. The RDP client tries to connect, but the server refuses because it thinks the session is still shutting down. By using rwinsta, you tell the session manager to drop that session completely—no waiting, no graceful shutdown. It's a hard kill. That clears the pending close state and frees up the connection slot.

I've seen this on Windows Server 2012 R2, 2016, and 2019. It's especially common on terminal servers with multiple users. The real fix isn't restarting the Remote Desktop service or rebooting the server (though that also works, it's slower).

Less Common Variations

Sometimes rwinsta won't work because the session is protected or you don't have admin rights. Here are other approaches.

Using Task Manager to End the Session

  1. Press Ctrl + Shift + Esc to open Task Manager.
  2. Click the Users tab.
  3. Right-click the stuck user session and select Sign off.
  4. Wait a few seconds, then try RDP again.

This does the same thing as rwinsta but through the GUI. If the Users tab shows no sessions, the issue might be deeper.

Restart the Remote Desktop Services

If killing the session fails, restart the service. This terminates all sessions, so be careful on a production server.

  1. Open Services (services.msc).
  2. Find Remote Desktop Services (or Terminal Services on older Windows).
  3. Right-click and select Restart.
  4. Wait 30 seconds. Then try RDP.

Warning: This boots everyone off. Do it during low usage.

Check for Corrupt Registry Keys (Rare)

On a few Windows 10 machines, I've seen a broken registry key cause this. It's uncommon but worth checking if nothing else works.

  1. Open Regedit (regedit.exe).
  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp.
  3. Look for a value named fResetBroken. If it's missing or set to 0, change it to 1. That tells the server to automatically reset broken sessions.
  4. Close Regedit and restart the Remote Desktop service.

This isn't a guaranteed fix, but it's helped me twice over the years.

Prevention

Once you get this working, you don't want it to happen again. Here's what I do on every terminal server I manage.

  • Set session idle time limits. In Group Policy, set Set time limit for active but idle Remote Desktop Services sessions to something like 15 minutes. If a session hangs after a disconnect, it'll get cleaned up faster.
  • Use the Automatic Reset feature. The registry key above (fResetBroken set to 1) is worth adding proactively.
  • Train users to log off properly. Sounds basic, but random disconnects are the main cause. A forced logoff script at the end of the day helps.
  • Schedule a weekly service restart. If you're on a terminal server with many users, a scheduled restart of the Remote Desktop Services every Sunday at 3 AM prevents session rot.

Most people see this error once and never again after applying the fix. If it keeps coming back, check your network for packet loss or look at the Event Viewer under Applications and Services Logs > Microsoft > Windows > TerminalServices-RemoteConnectionManager for clues.

Was this solution helpful?