Tool?

  • Thread starter Thread starter Calvin
  • Start date Start date
C

Calvin

Hello,

My task:
I need to delete files of the network that are older 90 days on a weekly
basis.

Current solution:
Manually search and delete the files.

My Problem:
It is time consuming to do this manually.

Help:
Is there a utility out there that can do this for me automatically?

Thanks,

Calvin
 
Something like this may work.

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) > 90 Then
f1.Delete
End If
Next
Set fso = Nothing
Set f = Nothing
Set fc = Nothing
 
Back
Top