in(1 was unexpected at this time.

for /L %%i in(1,1,23)do(
do something)
done

Open in new window

Run a windows batch file and got an error.

Thanks.
zhshqzycAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
brutaldevConnect With a Mentor Commented:
You need a space between IN and your bracket
EG:
 
for /L %%i in (1,1,23) do (echo %%i)

Open in new window

0
 
ReneGeConnect With a Mentor Commented:
@ECHO OFF
FOR /L %%i in (1,1,23) do (
ECHO %%i
)
ECHO done
PAUSE

Open in new window

0
 
brutaldevCommented:
You need a space between IN and your bracket
EG:
 
for /L %%i in (1,1,23) do (echo %%i)

Open in new window

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Steve KnightConnect With a Mentor IT ConsultancyCommented:
You need to add some spaces in there, e.g.

@echo off
for /L %%i in (1,1,23) do echo [%%i]

for /L %%i in (1,1,23) do (
echo [%%i]
)

Steve
0
 
zhshqzycAuthor Commented:
I remove done then everything is fine.
0
 
Steve KnightIT ConsultancyCommented:
Hmm, must refresh if delayed before submitting :-)
0
 
zhshqzycAuthor Commented:
Thanks.
0
 
ReneGeCommented:
Oh! I forgot to mention, you need to add spaces ;-)

Glad I could help.

Thanks for the points

Cheers,
Rene
0
 
Steve KnightIT ConsultancyCommented:
Yeah sorry ReneGe for watering down your result.... wasn't treading on toes.... just slow hitting submit :-)  Thanks for the point split anyway!

Steve
0
 
ReneGeCommented:
Friday PM & Humour is a very good mixt!

Always nice working with you Steve.

Cheers,
Rene
0
 
Steve KnightIT ConsultancyCommented:
haha, likewise.  Bed shortly here mind so you're free from my nicking your questions for a few hours if the boys let us sleep anyway....

Steve
0
 
ReneGeCommented:
Sweet dreams!
0
 
Steve KnightIT ConsultancyCommented:
Sounds like a dose of Corrie has been prescribed first.... zzzzzzzzzzz
0
All Courses

From novice to tech pro — start learning today.