Continuously check a file modified or not using batch file
<p>I am trying to create a batch file which is to continuously check the modified date of a file is changed or not. And if it is changed, then display a message box that "File has been modified". i have a simple code and but it showing some error in the execution..</p>

<pre><code>@echo off
setlocal
set FileName=F:\test\tester.txt
set FileTime=0 
:loop
for %%X in (%FileName%) do (
     if %FileTime% NEQ %%~tX (
        echo file modified
     ) else (
     echo no change )
set FileTime=%%~tX
)
ping -n 10 localhost &gt;nul 2&gt;nul
goto :loop
pause
</code></pre>