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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

automatic calculation 3
Can't delete file 3
Outlook Auto-Email 1
File Inheretance 3
PDF Files 3
How do I set up a footer file name to update autmatically 1
strange behavior 4
Deleting restore points 7

Back
Top