how to write this?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Mohammad_Dos
Posts: 84
Joined: 08 Sep 2010 10:25
Location: Iran,Kashan
Contact:

how to write this?

#1 Post by Mohammad_Dos » 22 Dec 2010 08:31

Hi,
I want:

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


how to do this works with batch file?

ChickenSoup
Posts: 79
Joined: 13 Dec 2010 10:32

Re: how to write this?

#2 Post by ChickenSoup » 22 Dec 2010 09:00

Here you go.

Batch file:

Code: Select all

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

Post Reply