Submitted By: Brantley allen

Deletes files 10 days old or older.

Visual Basic
Edit|Remove
FilePath = "\\server\folder" 
FileAge = 10

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(FilePath)
Set colFile = objFolder.Files
For Each objFile in colFile
	FileCreated = objFile.DateCreated
		If DateDiff("d", FileCreated, Now()) > FileAge Then 
 			objFile.Delete
		Else
		End If

Next