[Solved] Continuously check a file modified or not using batch file [closed]


My final Code. Thanks for your supports.

 @echo off
  setlocal enableextensions disabledelayedexpansion
  for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value')    do        
set "dt=%%a" 
set "td.YY=%dt:~2,2%" 
set "td.YYYY=%dt:~0,4%"
set "td.MM=%dt:~4,2%"
set "td.DD=%dt:~6,2%"

set "filename=%td.MM%%td.DD%%td.YY%.txt
:loop
for %%i in (%filename%) do (
        echo %%~ai|find "a" >nul && (
        cscript MessageBox.vbs "Today's Schedule Changed. Modified Time: %time%. Please Check AVScheduler ON or OFF."
        attrib -a %%i
) || (
rem echo no change
)
)
timeout 1 >nul
goto :loop

solved Continuously check a file modified or not using batch file [closed]