For every successful connection, the RDP client stores the connection details for the machine that you have connected to. This is often convenient, but if you are on a public machine, it can expose sensitive security details. The RDP client does not give any way to clear the cached connection history.
You can clear the RDP Cache history in a couple of ways:
- Open regedit.exe and navigate to:
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
- There are two registry keys here that need to be cleared:
- Default – Has the history of the last 10 RDP Connections.
- Servers – Contains a list of all the Remote Desktop connections that have ever been established from this machine.
- Expand the Default Key which will contain the most recently used connections. You can delete every entry or select which ones you want to remove:
- Select the entries that you want to remove, right click and click delete:
- Now expand the Servers key, this contains the details of all the RDP connections that have ever been made from this machine, including the username used to connect:
- There may be many entries, it is easier to delete the entire servers key, then recreate it.
- Finally, delete the default.rdp file found in your homepath. This is a hidden file and will not show or delete by default. You have to supply an extra switch to the delete command:
A far quicker way to clear the RDP cache is to use the following commands:
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default" /va /f reg delete "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers" /f reg add "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers" del /ah %homepath%\documents\default.rdp