2

Am looking for a powershell script that cleans (removes) all the items from the most-recently used programs from the Vista/Windows 7 Start menu.

NOTE: Cleaning the items does not mean disabling the MRU behavior - I still want it keep the MRU behavior on; just clean the immediate list of any entries.

user2666
  • 285
  • 2
  • 6
  • 8

2 Answers2

3

In Windows versions post Vista you just need to clean the folder

%userprofile%\AppData\Roaming\Microsoft\Windows\Recent

As for a script to do that, you could use a regular old command shell (.cmd)

del /F %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent\*.lnk

Or in PowerShell (thanks to @alastairs' comment)

Remove-Item -Force "${env:USERPROFILE}\AppData\Roaming\Microsoft\Windows\Recent‌​*.lnk"
user4767
  • 126
  • 3
  • 4
    The PowerShell equivalent (literal translation, and correcting typo in path) is: Remove-Item -Force "${env:USERPROFILE}\AppData\Roaming\Microsoft\Windows\Recent\*.lnk" – alastairs May 28 '09 at 20:34
0

I can't add a comment to the existing answer, but there is an environment variable for the AppData path that you should probably use instead, so:

del /F %APPDATA%\Microsoft\Windows\Recent*.lnk

Mark Sowul
  • 1,839
  • 1
  • 11
  • 14