Page 1 of 1

how to write this?

Posted: 22 Dec 2010 08:31
by Mohammad_Dos
Hi,
I want:

for i=1 to 10
echo i
if i=7 echo echo "seven"


how to do this works with batch file?

Re: how to write this?

Posted: 22 Dec 2010 09:00
by ChickenSoup
Here you go.

Batch file:

Code: Select all

for /l %%i in (1,1,10) do (
    echo %%i
    if %%i==7 echo "Seven"
)