Windows 如何在dos循环中使用多个命令

Windows 如何在dos循环中使用多个命令,windows,batch-file,for-loop,cmd,Windows,Batch File,For Loop,Cmd,我正试图在dos脚本.bat中为循环调用两个命令。第二个命令被忽略。它只是在控制台中显示,什么也不做。我一直在为循环样本搜索更多的,但没有成功 :loop FOR /L %%i IN (1,1,500) do ( REM command number 1 adb wait-for-device shell input touchscreen swipe 1400 800 200 800 1000 REM command number 2 adb wait-

我正试图在dos脚本
.bat
中为循环调用两个命令。第二个命令被忽略。它只是在控制台中显示,什么也不做。我一直在为循环样本搜索更多的
,但没有成功

:loop
FOR /L %%i IN (1,1,500) do (
    REM command number 1
    adb wait-for-device shell input touchscreen swipe 1400 800 200 800 1000
    REM command number 2    
    adb wait-for-device shell input touchscreen swipe 800 1400 200 800 1000
)
goto loop

你可以试着这样做

:loop
FOR /L %%i IN (1,1,500) do (
goto loop
)

:commands
#command number 1
adb wait-for-device shell input touchscreen swipe 1400 800 200 800 1000
#command number 2    
adb wait-for-device shell input touchscreen swipe 800 1400 200 800 1000
goto loop

我不是批处理文件的专家,我只是擅长典型编程,所以有些事情可能需要修复,但这里有一个想法。

#命令号…
实际上是批处理文件的一部分,还是您刚刚添加了它们以供说明?有两个以“adb”开头的命令,我使用了
#
作为注释
#
字符在批处理文件中不表示注释。更改为
REM