1

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
BSanders
  • 295
  • 1
  • 6
  • 29
  • 1
    possible duplicate of [How to recursively access subfolder files inside a folder in vbscript?](http://stackoverflow.com/questions/14950475/how-to-recursively-access-subfolder-files-inside-a-folder-in-vbscript) – Ansgar Wiechers May 15 '15 at 20:32

0 Answers0