Using IF Statement - Batch ScriptLoop For X Times

October 10, 2013 at 18:19:31
Specs: Windows 7
Hi,

I'd like to mention that this script is worked if we move "set /a _number +=1" before if statement. Thanks.


@echo off
set _number=0

:start
set /a _number +=1
if %_number%==500 goto end
echo %_number%
goto start

:end
echo it works~!
pause>nul


See More: Using IF Statement - Batch ScriptLoop For X Times

Report •


#1
October 11, 2013 at 06:43:43
It seems to work just fine when I ran it.1-499 displayed on the screen. if you move the set command to after the if statement it will count to 500. It looks like you are asking a question, but i am failing to see what is needed.

::mike

http://www.computing.net/howtos/sho...


Report •
Related Solutions


Ask Question