1.for循环---用于压力执行某个操作

前提:循环的路径须要确定且唯一

例:反复开关机

@echo off

set num=0
:ok  : 注释符“:”
set /a num+=1  : 用于统计执行的次数

adb wait-for-device  : 安卓设备连接&确认

ping -n 15 127.0.0.1>nul  : 静待15秒,ping15次127.0.0.1但不返回信息
ping -n 6 127.0.0.1>nul
adb reboot  : 执行重启

echo.ThisIsALoop,AlreadyRun %num% times  : 输出当前循环的次数

if "%num%"=="10000" @pause&&goto ending  : 满足条件后停止运行并跳转到ending:


goto ok  : 未达到终止条件,返回:ok,重新进入循环
ending:
@pause