0

我有一个包含某些子文件夹的文件夹..现在我想找到最后修改的子文件夹..有没有我可以使用的功能。

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objRootFolder = objFSO.GetFolder(FilePath)
Set colSubfolders = objRootFolder.SubFolders

For Each objFolder in colSubfolders


      WScript.Echo objFolder


      IF(objFolder.SubFolders.Count > 1 ) THEN

        For Each fldr In objFolder.SubFolders     


        END If         

        NEXT
            WScript.Echo LastFolder
        WScript.Echo LastDate
        END IF
        NEXT



Set FSO= Nothing

谢谢

4

1 回答 1

1
 set lastFolder = nothing
 lastTime = CDate("1900-01-01")

 For Each fldr In objFolder.SubFolders     
   If fldr.DateLastModified > lastTime Then
       Set lastFolder = fldr
       lastTime = fldr.DateLastModified
   End If
 Next 

 WScript.Echo lastFolder.Name
于 2013-11-05T15:46:41.327 回答