I whipped up handy VB Script that will delete files older then X days in any particular folder. In this case any files that are older then 3 days will be deleted.
Dim Fso, Directory, Modified, Files
Set Fso = CreateObject("Scripting.FileSystemObject")
Set Directory = Fso.GetFolder("C:\FolderContainingFiles")
Set Files = Directory.Files
For Each Modified in Files
If DateDiff("D", Modified.DateLastModified, Now) > 3 Then Modified.Delete
Next
Wednesday, May 5, 2010
Subscribe to:
Post Comments (Atom)
Nice clean script, works a charm.
ReplyDeleteThx for providing!
Perfect! I have a program that backs up to a new file every day. This keeps just the last 30 days. Works great.
ReplyDelete