How to Clear Remote Desktop Connections History

Once established connection to a remote computer, an RDP Connection of the user that has logged in will be saved. Later this information is used and suggests user use the connection that he/she has used previously.

This is a good and convenient to the end-user but unsafe from the security point of view, especially when the RDP connection is initiated from a public or untrusted computer.

The other point, the information of RDP saved in each user could not view by another user.

In this article, we will explain where Windows stores the history of Remote Desktop Connection and how to clear it.

How to remove the history of RDP Connections in Windows?

You cannot remove a computer or IP from the list of RDP connection from Windows UI, you have to make change by using Registry.

E.g: I wish to delete the RDP connection of the IP Address 10.100.10.3

Open the registry editor, regedit.exe then navigate to the key Computer\HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default , you will see all the most recently used RDP Connection.

Navigate to the name or IP address you wish to clear, select the key with the name MRU* then right-click Delete.

Then navigate to the second key Computer\HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers. Navigate to the name/IP of the RDP Connection then right-click Delete. Since this key save the username information.

Verify the list of RDP Connection, open Remote Desktop Connection or run mstsc.msc, the server that deleted in the registry should be cleared.

Another hot script on how to clear the RDP Connection History

One click to clear All the RDP Connections history by using a script. Create a batch file for using it clean up the RDP history, you can use it on Windows Start-up for automating clean-up.

The small batch script like below

@echo off
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"
cd %userprofile%\documents\attrib Default.rdp -s -h
del Default.rdp

Let’s clarify all the steps of the script:

  • Disable the output of the information to the console
  • Delete all the values in HKCU\Software\Microsoft\Terminal Server Client\Default (clear the list of recent connections)
  • Remove the entire contents from HKCU\Software\Microsoft\Terminal Server Client\Servers (clears the rdp connection history and the stored user names)
  • Recreate the previously deleted branch
  • Go to the directory with the Default.rdp file.
  • Change the Default.rdp file attributes, by default it is Hidden and System
  • Delete the file Default.rdp file

Another option for deleting RDP Connection history by using cleaner software such as CCleaner,…

That’s it. Hope it deals with your problem.

Leave a Reply

avatar
  Subscribe  
Notify of