Automatic File Deletion

  • Thread starter Thread starter Mike
  • Start date Start date
This VBScript may work for you.

Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("J:\aaaa")
Set fc = f.Files
For Each f1 in fc
If DateDiff("d", f1.DateLastModified, Now) > 30 Then
f1.Delete
End If
Next
Set fso = Nothing
Set f = Nothing
Set fc = Nothing
 
Back
Top