Run a vbs script every 5 minutes?
Found this on expertsexchange
'=======================
' Create a FileSystemObject
Set fso = CreateObject("Scripting.FileSystemObject")
' Enter your folder to start deleting files from
startFolder = "C:\TEST"
' Enter the names of folders to exclude from checking:
arrFoldersToExclude = Array("TheVolumeSettingsFolder",".TemporaryItems")
strFoldersToExclude = ";" & Join(arrFoldersToExclude, ";") & ";"
arrFilesToExclude = Array("ds_store")
strFilesToExclude = ";" & Join(arrFilesToExclude, ";") & ";"
' This sets the amount of days old for files to be, before
' they are deleted. The number must be negative.
OlderThanDate = DateAdd("d", -31, Date) ' 31 days (adjust as necessary)
' This calls the function that actually deletes the files.
DeleteOldFiles startFolder, OlderThanDate
Function DeleteOldFiles(folderName, BeforeDate)
Dim folder, file, fileCollection, folderCollection, subFolder
' Get the folder to delete files from
Set folder = fso.GetFolder(folderName)
' Check if the current folder name is in the strFoldersToExclude String
If InStr(LCase(strFoldersToExclude), ";" & LCase(folder.Name) & ";") = 0 Then
' Return a collection of all of the files in that folder
Set fileCollection = folder.Files
' Go through each file....
For Each file In fileCollection
' ... to check if the DateLastModified value is before
' the minimum age of files to delete.
If file.DateLastModified < BeforeDate Then
If InStr(LCase(strFilesToExclude), ";" & LCase(file.Name) & ";") = 0 Then
fso.DeleteFile file.Path, true
End If
End If
Next
End If
' Get the next collection of SubFolders to go through
Set folderCollection = folder.SubFolders
' Go through each subFolder
For Each subFolder In folderCollection
DeleteOldFiles subFolder.Path, BeforeDate
If (subFolder.Files.Count = 0) Then
Call subFolder.Delete()
End If
Next
End Function
'=======================