首页 > 学院 > 开发设计 > 正文

Windows Bat脚本Sleep, loop, if/else

2019-11-09 15:45:38
字体:
来源:转载
供稿:网友

对Android设备进行反复亮屏/灭屏脚本

ScreenOnOff.bat: 

@echo offecho 请插入您的手机adb wait-for-device::for /L %%i in (1,1,3) do adb shell input keyevent 26set counter=0set max=100:loopecho Open Screenadb shell input keyevent 26call Sleep.bat ms 5000 echo Close Screenadb shell input keyevent 26call Sleep.bat ms 5000if not %counter%==%max% goto looppause

Sleep.bat: 

@echo offif "%1"=="ms" ( goto delay_ms) else ( goto delay_sec):delay_msecho delay %2 msecho Wscript.Sleep WScript.Arguments(0) >%tmp%/delay.vbs	::echo %time%cscript //b //nologo %tmp%/delay.vbs %2::echo %time%goto end:delay_sececho delay %2 secping 127.0.0.1 -n %2 1>nul:end


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表