Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oNewestFile = Nothing
sFolder = "C:\Temp\"
If oFSO.FolderExists(sFolder) Then
For Each oFile In oFSO.GetFolder(sFolder).Files
If oNewestFile Is Nothing Then
Set oNewestFile = oFile
Else
If oNewestFile.DateCreated < oFile.DateCreated Then
Set oNewestFile = oFile
End If
End If
Next
End If
If oNewestFile IsNot Nothing Then
WScript.Echo oNewestFile.Name & " " & oNewestFile.DateCreated
End If