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
infinte loop
Moderator: DosItHelp
Re: infinte loop
... if count equ 10 (
count is the variable name, but not the variable. Use %count%.
Regards
aGerman
Re: infinte loop
In the starting use:
:1
and on end use:
goto1
:1
and on end use:
goto1