Delete Recent Items

By | August 12, 2006

Here is just a script that I came across that deletes items in your recent folder. Simple yes, but the goal is to make things easier on network admins.

Copy and paste the text below into notepad and save as DelRecent.vbs

 

———-COPY EVERYTHING BELOW THIS LINE———-

Dim Act    : Set Act = CreateObject(“Wscript.shell”)
Dim Fso    : Set Fso = CreateObject(“Scripting.FileSystemObject”)
Dim User   : User = Act.ExpandEnvironmentStrings(“%userProfile%\recent\”)
Dim Folder : Set Folder = Fso.GetFolder(User)
Dim Files  : Set Files = Folder.Files
Dim objFile
For Each objFile in Files
Fso.DeleteFile(objFile.Path), True
Next
Act.Popup “Completed Script”,5,”Finished”,0 + 32 + 0

———-COPY EVERYTHING ABOVE THIS LINE———-

If you don’t want the popup at the end, just comment out the last line using a ‘

The user who posted this script goes under the name gunsmokingman

THIS INFORMATION IS PROVIDED “AS IS” WITH NO WARRANTIES EXPRESSED OR IMPLIED.

Leave a Reply

Your email address will not be published. Required fields are marked *