code:
Function CheckFileDate( strPath, intDaysOld )
On Error Resume Next
Dim objFSO, objFile
CheckFileDate = retvalUnknown ' Unless indicated otherwise
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strPath)
If( Err.Number <> 0 ) Then
EXPLANATION = "Unable to retrieve filedate"
Else
If( objFile.DateLastModified > now-intDaysOld ) Then
EXPLANATION = "File date is OK; date=[" & objFile.DateLastModified & "], limit=[" & intDaysOld & " days]"
CheckFileDate = True
Else
EXPLANATION = "File date is exceeding the limit; date=[" & objFile.DateLastModified & "], limit=[" & intDaysOld & " days]"
CheckFileDate = False
End If
End If
End Function