This is a variation of this script to find the latest subfolder:
VBSTART
Function NewestSubFolder(Folder)
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(Folder)
dPrevDate = "0"
For Each oSubFolder In oFolder.SubFolders
If DateDiff("s", dPrevDate, oSubFolder.DateLastModified) > 0 Then
sNewestSub = oSubFolder.Path
dPrevDate = oSubFolder.DateLastModified
End If
Next
NewestSubFolder = sNewestSub
End Function
VBEND
VBEval>NewestSubFolder("c:\temp"),folderpath
Find Newest SubFolder in a Folder
Moderators: Dorian (MJT support), JRL, Phil Pendlebury
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Find Newest SubFolder in a Folder
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?