Const strPath = "D:\shared\temp"
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
Call Search (strPath)
Sub Search(str)
Dim objFolder, objSubFolder, objFile
Set objFolder = objFSO.GetFolder(str)
For Each objFile In objFolder.Files
If objFile.DateCreated < (Now() - 1) Then
objFile.Delete(True)
End If
Next
For Each objSubFolder In objFolder.Subfolders
Flag = ""
If objSubFolder.DateCreated < (Now() - 1) Then
For Each Thing in objSubFolder
If thing.DateCreated > Now() - 1 then Flag="yes"
Next
If Flag = "yes" then objSubFolder.Delete(True)
End If
Next
End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Expert of the Year award recognizes an expert who helped improve Experts Exchange in the past year through high levels of contributions and participation on site. This award is given to the expert who has achieved the highest levels of participation, while maintaining quality contributions and professionalism.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.