1

我正在尝试编写一个脚本来遍历我的 DFS 环境中的所有文件夹,如果文件夹名称为“Temp”,那么我希望脚本删除该文件夹中超过 5 天的所有文件。

这是我迄今为止没有太多运气的尝试。

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
4

0 回答 0