' Collection of code snippets by Arne Vajhøj ' posted to eksperten.dk, usenet and other places (2002-now) oldfnm = "" olddlm = "01-01-2100 00:00:00" Set fso = CreateObject("Scripting.FileSystemObject") Set dir = fso.GetFolder("C:\") For Each f in dir.Files WScript.Echo f.Name & " " & f.DateLastModified If DateDiff("s", olddlm, f.DateLastModified) < 0 Then oldfnm = f.Name olddlm = f.DateLastModified End If Next Set dir = Nothing Set fso = Nothing WScript.Echo "Oldest file: " & oldfnm & " " & olddlm