How To Remove IP Addresses From Remote Desktop Connection History

An easy way to remove ip addresses from remote desktop connection history would be if you could right-click an entry and select “delete” in the popup menu. Unfortunately, it doesn’t work that way. If you want to delete one or more entries in the remote desktop connection history dropdown list, you’re going to have to do so via the Windows registry.

It goes without saying that a list of “remembered” entries in the remote desktop window is very convenient, but there may be times when you want to clean up the list.

Remote Desktop Connection - Recently Used Connections

As you may know, the list of previously made connections in remote desktop can contain both computer names and IP addresses. It is possible to remove entries from the history list via Windows registry editor and by removing the default.rdp file. A bit further down below, I will also provide a batch command file that you can use to automatically make the necessary changes to remove ip addresses from remote desktop connection entries, but first I will describe the steps to manually delete the entries.

Using Registry Editor To Remove IP Addresses From Remote Desktop Connection

Please note that using the Windows registry incorrectly editor can cause damage to your system or can in some cases prevent your pc from starting up normally. If you follow the steps below exactly, you will be fine.

In order to get started, press the Windows-key + r keyboard combination to bring up the “Run” box:

Press the Windows key + r to open the "Run" box

Then, in the “Run” window, type “regedit” (without the quotes) and click ok.

Type regedit and click ok

A user account control window will pop up. Click yes to continue.

Click yes in the user account control window to continue

Now the Windows registry editor will appear.

Navigate to HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client and click the “Default” key.

You’ll see a number of “MRU” (Most Recently Used) entries listed there, like illustrated in the image here:

The HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client key

Now you can click and drag over the entries to select them and then right-click and delete them.

Select and delete to remove ip addresses from remote desktop connection

Next, select the subkey called “Servers” in HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client

Select subkey "Servers"

You’ll notice that, under this key, there are a number of entries as well, for all the remote desktop connections that have previously been successfully established.

Here you will find that you cannot select multiple entries at once, so it’s best to delete the entire subkey “Servers” altogether and recreate a new one. To do so, right click the subkey “Servers” and select “Delete”.

Then, right-click the “Terminal Server Client” subkey and select “New > Key”.

Delete the subkey

Then, right-click the “Terminal Server Client” subkey and select “New > Key”.

Recreate the server key for remote desktop connections

Enter “Servers” (without the quotes) as the name and press ENTER to confirm.

Type the name Servers for the remote desktop connection registry key

Good news! As far as registry modifications are concerned, the job is done here. You can now close registry editor.

With these items removed from your Windows registry, all that remains to be done is to remove the “Default.rdp” file from your documents folder. Close the registry editor and launch file explorer to navigate to your documents folder and find the file “Default.rdp”


Please note that “Default.rdp” is a hidden file, so you may need to check the box to show hidden items under the “View” tab in file explorer.

Check the box to show hidden items

Delete the Default.rdp file to finalize the steps needed to remove ip addresses from remote desktop connection history.

Remove IP Addresses From Remote Desktop Connection With A Batch Command File

All the steps described above can also be automated in a .bat command file. You can create a .bat file with the following content and execute the file to get the job done (Simply copy/paste the following lines in a text file and save it as a .bat file):

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
echo "ip addresses have been removed from remote desktop connection, press any key to continue"
pause

Creating and executing this batch file will automatically perform the steps necessary to remove ip addresses from remote desktop connection history.

If you want you can also download the script command file here. Simply save it on your desktop and double-click to clear your remote desktop connection history. Enjoy!

I hope you found this article useful. If you did, please click below to like the page or leave a short comment. Thank you!


If you've enjoyed this article or found it useful, I'd appreciate it if you'd let me know by clicking the Like (or Share) button below. Thank you!


New! Comments

Have your say about what you just read! Leave me a comment in the box below.
Enjoy this page? Please pay it forward. Here's how...

Would you prefer to share this page with others by linking to it?

  1. Click on the HTML link code below.
  2. Copy and paste it, adding a note of your own, into your blog, a Web page, forums, a blog comment, your Facebook account, or anywhere that someone would find this page valuable.