我需要创建一个脚本来检查目录中的任何.TIF文件是否超过10分钟,如果是,则发送一封电子邮件提醒我。我希望超时的脚本,每10分钟运行一次。这是一个极端粗略的草案
: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`