Here's source code for a similar, simplified (less elegant, but perfectly functional) utility that will clear the entire recent projects list with one button click. To use this source code, in Visual Studio, create a new Windows Form project (VB), rename the form to "MainForm", adjust the form size and caption as you like, add a single button and name it "ClearBtn". Add the line "Imports Microsoft.Win32" to the top of your form's code module (needed for registry access functions). Create an event handler for the button's CLICK event, and update the click event handler's code to match what is shown below.
If you want to convert this to work with a different MS Visual Studio version or related Microsoft IDE, I would recommend doing a little research to find the registry subkey that said IDE uses and replace the registry string reference in the source code below with the corrected subkey (regKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\VisualStudio\9.0\ProjectMRUList", True))
Like the earlier tool, this can be added as an external tool into Visual Studio, but it doesn't refresh the list that's already displayed, which is only requeried by Visual Studio when it's relaunched. Maybe there's a way to do that.. you could also modify this application to clear the recent project list and then have it launch Visual Studio for you as a sort of "pre-loader" instead of using it as a tool from within Visual Studio, if you are really fastidious about keeping that list cleared. I like to clear this list so I can make tutorial videos and not have a cluttered screen that references projects unrelated to the tutorial.
Entire source code:
'--FORM SOURCE BEGINS-------------------------------
Imports Microsoft.Win32
Public Class MainForm
Private Sub ClearBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearBtn.Click
Dim regKey As RegistryKey
Dim str As String(), i As Integer, removed As Integer
removed = 0
Try
regKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\VisualStudio\9.0\ProjectMRUList", True)
str = regKey.GetValueNames()
If str.GetLength(0) > 0 Then
For i = 0 To str.GetUpperBound(0)
If str.GetValue(i).ToString().Contains("File") Then
regKey.DeleteValue(str.GetValue(i).ToString())
removed = removed + 1
End If
Next
End If
regKey.Close()
Catch ex As Exception
' Most likely cause of an exception is that the registry key/subkey specified does not exist
MessageBox.Show(ex.Message())
End Try
If removed > 0 Then
MessageBox.Show("Changes will be visible the next time Visual Studio 2008 is launched.", _
"Info", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show("Nothing to do.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Application.Exit()
End Sub
End Class
'--FORM SOURCE ENDS---------------------------------