Did you notice that in Windows XP it takes exactly half a dozen mouse clicks to clear the Recent Documents history in the new Start menu. This is the option that I’m talking about:

One of our readers asked "I need a batch file or script to clear the recent documents list from the Windows XP Start Menu". This is a legitimate request. So, here is a VBScript that’ll automate the work for you. It works in Windows XP, Windows Vista and Windows 7. Note that if you’re using Windows Vista/7, there is no real need for such a script, because you can do it directly from the Start menu. (Click Start, right-click Recent Items, and then click Clear Recent Items List)

Script to Clear Recent Documents History (Windows XP/Vista/7)
Set objFSO = CreateObject("Scripting.FileSystemObject")
sRD = WshShell.SpecialFolders("Recent")
if sRD <> "" then
On Error Resume Next
objFSO.DeleteFile(sRD & "\*.lnk")
end if
Instructions
Copy the above code to Notepad, and save the file with .vbs extension. (e.g. clearrecent.vbs) You can then move this script to your Quick Launch folder for easy access. Note that if you create a shortcut of the script in the Quick Launch folder, you can even customize the icon if you’re bored of seeing the default Windows Script icon.
Related Posts
- “Clear Recent Items List” Option Missing When You Right-Click on the Recent Folder
- How to Clear Jump Lists MRU in Windows 7
- How to Clear System Information Tool (MSInfo32.Exe) History in Windows XP
- How to Clear Task Scheduler History in Windows Vista and Windows 7
- Add CCleaner Button to Internet Explorer Toolbar
If you enjoyed this post, make sure you subscribe to our RSS feed! We feature Tips, Troubleshooting information, Scripts and Utilities for Microsoft Windows Operating Systems!
Prefer an E-mail subscription?





Thank you, works great
this script very heklpfull. Thanks
Wow, such quick help!
Have modified my version and tested and all is well.
Thanks Ramesh!
- Greg
@Greg: Updated the script in article.
Ramesh,
Oh, I see the bug. sRD is the pathname to the recent files folder. However, since the folder always exists, the test is always true, even if the folder is empty. So it always tries to delete the links and, when there ARE NO links, it gets an error.
Is there a way to suppress the error and continue execution?
- Greg
This Works!
Another masterful article by Ramesh Srinivasan – thank you again. The method I found here months ago (here- http://www.winhelponline.com/blog/clear-recent-items-list-missing-right-click-recent-folder/) has turned out to work only until the next reboot. Vista manages to shred it up over and over – so annoying.
The whole Recent Items function is buggy in Vista; some documents do not get listed after they are opened, some do. I have yet to discern a pattern.
However, at least for clearing the list, the script offered on this page will work. It stays put too. Really. No kidding.