bat脚本goto循环求助,想在ping这个步骤添加个循环次数例如30次不通就结束bat,如果ping通了就执行Connect下面的步骤。请问要怎么做啊?谢谢- @echo off
- ::检测网络是否连接再进行下一步
- :Ping
- ping 192.168.1.1 && goto Connect || goto Ping
- :Connect
- ping 192.168.1.10 -n 1 | find "TTL"
- if errorlevel 1 goto Stop
- if errorlevel 0 goto Action
- exit
- :Stop
- net use * /d /y
- exit
- :Action
- net use * /d /y
- net use z: \\192.168.1.10\Video "123456" /user:123
- net use y: \\192.168.1.10\Music "123456" /user:123
- net use x: \\192.168.1.10\Driver "123456" /user:123
- net use w: \\192.168.1.10\Soft "123456" /user:123
- exit
复制代码 |