Well if you are open to VBScript you could use this I have just knocked up:
DIM filename, filesys, file1, timediff
If Wscript.Arguments.Count = 0 Then
Wscript.echo "9999 Error - no file specified"
ELSE
Set filesys = CreateObject("Scripting.Fi
Set file1 = filesys.GetFile(wscript.ar
timediff = int((now - file1.DateCreated) * 60 * 24)
'Send age in minutes back to console:
if timediff >=20 then wscript.echo "ERROR: " & file1.name & " is " & timediff & " minutes old."
End if
Save that as "checktimes.vbs" and you can run it from your batch file with a command line of the oldest file in a dir and get back something like
cscript //nologo checktimes.vbs "c:\somedir\file1.vbs"
ERROR: file1.vbs is 15516 minutes old.
You can get the oldest file in a dir as part of the VBScript or call it from the batch files you are familiar with, e.g. this for loop witll get the file for you -- a DIR command in date order to get the oldest file first of a spec:
@echo off
for /f "tokens=*" %%a in ('dir /b /a-d /od "c:\whateverdir\*.edi"') do cscript //nologo checktimes.vbs "%%~fa" & exit /b
REM rest of script
Main Topics
Browse All Topics





by: uucknaaaPosted on 2009-09-27 at 23:51:52ID: 25437155
Hi
e.com/OS/ M icrosoft_O perating_S ystems/MS_ DOS/Q_2104 5974.html
Here's one solution found here at EE:
http://www.experts-exchang
Check it out.