如何在dos循环

时间:2018-04-06 08:37:41

标签: windows batch-file for-loop cmd

我试图在dos脚本for-loop中调用.bat中的两个命令。第二个命令被忽略。它只是在控制台中显示,什么都不做。我一直在寻找更多的for-loop样本,但没有成功。

: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

1 个答案:

答案 0 :(得分:-3)

您可以尝试这样做,

: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

我不是批处理文件的专家,我在典型的编程方面很不错,所以有些东西可能需要修复,但这是一个想法。

相关问题