1

I need to create a script that checks to see if any of the .TIF files in the directory are older than 10 minutes and if so send out an e-mail to alert me. The script I would like to timeout and only run every 10 minutes. heres an extreme rough draft

:start
set date=%date:~4,2%-%date:~7,2%-%date:~10,4%
setlocal EnableDelayedExpansion
SET filename="\\molinevm\NG Batch\FAX\"
if [ FOR %%f IN (%filename%) DO SET filedatetime=%%~tf
IF (%currentDate%-%filedatetime%) < 600 goto :noProblem // this checks to see if all files are within the "OK" time range and skips down if they are ok. 
echo "Faxes have been in molinevm for longer than 10 minutes." | mail -s "Faxes Not Working"     "my email"
:noProblem 
timeout /t 600 /nobreak
goto :start`
Wahyu Kristianto
  • 8,719
  • 6
  • 43
  • 68
  • You cannot do date/time arithmetics in pure batch scripting, you'd need to write your own (extensive) date/time maths code; hence I recommend to follow one of the answers of this question: [Find out if file is older than 4 hours in Batch file](http://stackoverflow.com/q/6928552)... – aschipfl Jul 07 '16 at 20:33

0 Answers0