I am trying to come up with a script to loop through all of the folders in my DFS environment and if the folder name is "Temp" then I want the script to delete all files in that folder older than 5 days of age.
This is what I was trying thus far without much luck.
Dim oFSO, oFolder, oSubFolder, i
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder("\\DFS\Folders")
Set oSubFolder = oFolder.SubFolders
For Each i in oSubFolder
If i.Name = "Temp" Then
MsgBox oSubFolder & " " & i.Name
'loop through files and delete files older and 5 days of age
End If
Next