Automatically clears the IP history recorded by the Windows system after connecting via mstsc Remote Desktop

Tips:This article was last updated in2025-07-19 16:41:22, some articles are time-sensitive, if there are errors or the download address is invalid, please in the comment area at the end of the articlemessage

In our daily use of Windows 10/11 system comes with itremoteAfter the desktop is connected, there will always be a history left in the remote desktop connection box, as shown in the figure below. If there are many machines that have been connected, even if they just try to connect, they will be recorded under the remote desktop connection box, and multiple records will affect us to quickly select the machine to actually connect to next time, which is very distressing.

Picture [1] - Automatically clear the IP history recorded by the Windows system after connecting via mstsc Remote Desktop - eleven sheets

Eleven (www.11zhang.com) also shared a "Clear Windows 10/11 system Remote Desktop connection records".

Today, a friend asked: Can the remote desktop connection record be automatically cleared every time the remote desktop connection is disconnected?

Picture [2] - Automatically clear the IP history recorded by the Windows system after connecting via mstsc Remote Desktop - eleven sheets

In Windows 10/11 systems, after using mstsc (Remote Desktop Connection), the system records the IP address or computer name of the most recently connected. These records are usually stored in the registry and in the Default.rdp configuration file. To automatically clear these records, we can write a script (such as a batch or PowerShell script) to delete these registry keys and configuration files, and then set the script to run every time a user logs out or log in, or through task scheduling to run periodically.

Procedure:

1. Create a batch script ClearRDPHistory.bat file, omitted here, eleven (www.11zhang.com) have already written the batch script.

Download address(Free for members of this site):

Effect:

2. Configure the task scheduler to execute automatically, or execute batch scripts through third-party scheduled task tools, one is recommended here zTasker Automated task tools that can be triggered with automated conditions such as scheduled or system events.

For example, I use zTasker Create a new batch script that automatically executes remote record cleaning after 10 seconds of booting, and follow these steps:

(1) After opening the zTasker tool, click [newly built] task button, as shown in the figure below;

Picture [3] - Automatically clear the IP history recorded by the Windows system after connecting via mstsc Remote Desktop - eleven sheets

(2) Select "Task Type":Run the program, select the batch script for Program Path, and checkRun as an administratorAs shown below;

Picture [4] - Automatically clear the IP history recorded by the Windows system after connecting via mstsc Remote Desktop - eleven sheets

(3) The plan is set to choose 10 seconds after the boot, as shown in the figure below;

Picture [5] - Automatically clear the IP history recorded by the Windows system after connecting via mstsc Remote Desktop - eleven sheets

(4) The setting is completed, as shown in the figure below;

Picture [6] - Automatically clear the IP history recorded by the Windows system after connecting via mstsc Remote Desktop - eleven sheets

(5) In the same way, you can also set the batch processing to be executed every hour/minute.

Picture[7] - Automatically clear the IP history recorded by the Windows system after connecting via mstsc Remote Desktop - eleven sheets
Automatically clears the IP history recorded by the Windows system after connecting via mstsc Remote Desktop - eleven
Batch script ClearRDPHistory.bat file download address
This content is paid to read, please check it out after paying
10
Buy now
You are not currently logged in! It is recommended to purchase after logging in to save your purchase history
Paid reading
© Copyright Notice
THE END
If you find this article helpful, you can bookmark this website for easy access next time!
Like13 share
comments Grab the sofa

Please log in to post a comment

    No comments yet