Clear Most Recently Used – Remote Desktop

|
' Script: ClearRDMRU.vbs
'Purpose: Clears the Most Recently Used list of computers in the Remote
'Desktop Client Computer drop down box
' Author: Brian Heil
' Date: 15 March 2004
'Version: V1.2
'History:
' V1.0 - first script.  used WMI to delete registry entries.
' V1.1 - added deletion of Default.RDP file to clear the computer box as well as the dropdown.
' V1.2 - changed to wscript RegDelete method, sped up deletion loop significantly.

On Error Resume Next

Set WSHShell = WScript.createObject("WScript.Shell")
Set File = CreateObject("Scripting.FileSystemObject")
MYDocs = WSHShell.specialfolders("MyDocuments")
For i = 0 to 9
WSHShell.regdelete "HKCUSoftwareMicrosoftTerminal Server ClientDefaultmru" & i
Next
        'Deletes the Default.RDP file in the current users My Documents directory.  This holds the value
        ' in the default value in Computer box in the RDC
        File.DeleteFile(MyDocs & "default.rdp")
        MsgBox "MRU List Cleared." & vbcrlf & junk,64,"Success"
Originally Posted on July 18, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.