RDP (Remote Desktop Protocol) is the important settings of Windows 10, as this allows the user to remotely take control of any computer on the network. This software is included with several versions of Windows, including 2000, XP, Vista, 7, 8, 8.1 and 10. When the user connects to the Remote desktop server, then your connection history is saved so there is no need to remember the name or IP of the remote computer. This is also convenient to the consumer’s viewpoint, but also unsafe from the security point, especially when the RDP connection is instigated from a public or untrusted computer. The information about terminal sessions is stored individually to the computer. So as per privacy and security, you need to remove RDP history.
In this article, we are discussing how to remove Remote Desktop Connection Windows 10.
How to Clear RDP Cache in Windows 10
There are three ways to clear Remote Desktop history in Windows 10. Here check out the three ways one by one:
1. How to Remove RDP Connections Cache from the Registry
For deleting Windows 10 Remote Desktop Connections history, you need to manipulate the registry entries.
Note: Manipulating registry entries is very risky as well as difficult as making a small mistake can adversely affect the entire system. So be careful while editing registry entries and create a System Restore point first. Or make use of the Registry Repair Tool as this will automatically fix the registry issues.
- Press Windows + R and then put regedit in the Run dialog box to open Registry Editor. Now click OK.
- Next, in the left Window of Registry Editor, move to following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default
- In the right windows of this location, navigate for the registry string named MRUnumber where the number may be 0, 1, 2…. You need to right-click on this string > select Delete.
- Next close Registry Editor and restart your PC.
After restarting your system, you’ll realize that recent Remote Desktop Connections history is no longer visible under Start Menu.
Helpful Article: Fix: Windows 10 Remote Desktop Protocol (RDP) Not Working Properly Issue
How to clear the RDP connection history using a script
After deleting the RDP connections cache manually from the registry, here check the steps to clear remote desktop history using a script. It offers a small script (BAT file) that allows you to automatically remove RDP history.
For automating the RDP history cleanup, put the below-given script in the startup or deploy it to computers by making use of the group policy.
@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
Please Note: Sometimes, the documents folder can be moved from standard directory c:\users\%username%\documents (for instance, on another partition due to lack of space on system drive). So in this case, you need to change the path to the directory or manually locate the file Default.rdp!
Have a look at all the actions of the script:
- Stop the information output of the console
- Remove entire values in the registry key HKCU\Software\Microsoft\Terminal Server Client\Default (clear list of recent RDP connections)
- Remove entire contents from HKCU\Software\Microsoft\Terminal Server Client\Servers (clears the saved usernames and RDP connection history)
- And rebuild the earlier deleted registry key
- Then go to the directory with Default.rdp file
- Modify Default.rdp file attributes, it is by default Hidden and System
- Delete Default.rdp file
Additionally, clear the history of RDP connections by making use of the following PowerShell script:
Get-ChildItem “HKCU:\Software\Microsoft\Terminal Server Client” -Recurse | Remove-ItemProperty -Name UsernameHint -Ea 0
Remove-Item -Path ‘HKCU:\Software\Microsoft\Terminal Server Client\servers’ -Recurse 2>&1 | Out-Null
Remove-ItemProperty -Path ‘HKCU:\Software\Microsoft\Terminal Server Client\Default’ ‘MR*’ 2>&1 | Out-Null
$docs = [environment]::getfolderpath(“mydocuments”) + ‘\Default.rdp’
remove-item $docs -Force 2>&1 | Out-Null
Please Note: The feature of the RDP history cleanup are built into various system and registry “cleaners”, like CCleaner etc.
If in case you desire to completely disable history of remote desktop, then try preventing everyone from writing these registry keys, (you should understand this is an unsupported configuration)
3. Clearing Cached RDP Credentials
If while establishing new remote RDP connections, before typing the password, you check an option Remember Me, and then the username and password will be saved in system Credential Manager. And when the next time you connect to the same computer, the RDP client automatically uses previously saved the password for remote desktop authorization.
The password is removed directly from client’s mstsc.exe window > choose a same connection from the connections list > click on Delete button. After that confirm saved credentials for deletion.
On the other hand, delete saved password directly from Windows Credential Manager and go to Control Panel\User Accounts\Credential Manager section. Choose Manage Windows Credentials in the list of saved passwords locate the computer name (in following format TERMSRV/192.168.1.100). And after expand found item > click Remove button
Then in a domain environment, disable saving passwords for RDP connections by utilizing special policy Network access: Do not allow storage of passwords and credentials for network authentication.
So, these are ways that help you to clear remote desktop history.
Conclusion: Hope that by manipulating registry entries you can clear the RDP history in Windows 10. You can also make use of the Registry Repair Tool to avoid any other damages to the PC as taking these steps manually is risky or you can go for automatic tool.