Hi,
File Availibility test: create or modification date
where can i choose which date would be tested ?
Thanks
BR Andre
File Availability older than: create or modification date
This test does not check creation time, just last modification time (modification time = creation time when file was not edited).
If you need to check creation time, you may use Shell Script test and some simple script like this:
Regards
Alex
If you need to check creation time, you may use Shell Script test and some simple script like this:
Code: Select all
Option Explicit
const statusUnknown = "scriptRes:Unknown:"
const statusOk = "scriptRes:Ok:"
const statusBad = "scriptRes:Bad:"
Dim fso, objFSO, objFile, strFile, objArgs, diff
Set objArgs = WScript.Arguments
if objArgs.Count<1 then
WScript.StdOut.Write statusUnknown & "required parameters: <path to file> [<threshold in hours>]"
Wscript.Quit
End if
strFile = objArgs(0)
Set objFSO = CREATEOBJECT("Scripting.FileSystemObject")
if objFSO.FileExists(strFile) then
SET objFile = objFSO.GetFile(strFile)
else
WScript.StdOut.Write statusUnknown & "File does not exists: " & strFile
Wscript.Quit
end If
if objArgs.Count=1 then
WScript.StdOut.Write statusOk & objFile.DateCreated
else
diff = DateDiff("h", objFile.DateCreated, Now())
if diff > int(objArgs(1)) then
WScript.StdOut.Write statusBad & diff
else
WScript.StdOut.Write statusOk & diff
end if
end if
Alex