infinte loop
Posted: 19 Apr 2011 11:33
Hi All
Kindly explain as to why the loop runs infinitely
@echo off
set /a count=1
:loop
if exist d:\p.txt (
echo file found
) else ( if count equ 10 (
goto endloop
) else (
set /a count=%count%+1
echo %count%
goto loop
)
)
:endloop
Thanks & regards
Ahshan
Kindly explain as to why the loop runs infinitely
@echo off
set /a count=1
:loop
if exist d:\p.txt (
echo file found
) else ( if count equ 10 (
goto endloop
) else (
set /a count=%count%+1
echo %count%
goto loop
)
)
:endloop
Thanks & regards
Ahshan