I have this script in one of batch which search and call copy_sendmail.bat
Everytime it runs I get log file run_bats_alarm.txt
When I check run_bats_alarm.txt I see it was runned 6 times for 1 second appart
echo start run bats %date% %time% >> run_bats_alarm.txt
set startdir=%cd%
for /d %%i in (*) do (
cd %%i
if exist "copy_sendmail.bat" call "copy_sendmail.bat"
cd %startdir%
)
In next bat file I have this at the bottom of batch
start cmd /c "\\cpisrv1\skleda\programi\progscr\logiranje\log.bat"
in file log.bat I have also this for logs
echo start run log %date% %time% >> log.txt
and when I check I check log.txt I see it is runned every fev seconds or minutes, like this hour_minutes_seconds
18_20_22
18_20_31
18_20_56
18_22_02
18_24_30
18_35_21