Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to run these 3 .bat files in loop. Tried these 2 codes and got invalid syntax error from both

@echo off
:loop
start "c:1.bat" && "c:2.bat" && "c:3.bat" &&
GOTO :loop

and

@echo off
for /l %%x in (1, 1, 9999) do (
    start "c:1.bat" && "c:2.bat" && "c:3.bat" &&
   set /a loopCount=%loopCount%-1
   if %loopCount%==0 GOTO:EOF
)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
669 views
Welcome To Ask or Share your Answers For Others

1 Answer

The answer is

@echo off
cd c:
:loop
start 1.bat
start 2.bat
start 3.bat
goto loop

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...