@Echo Off
if not "%1"=="h" mshta vbscript:createobject("wscript.shell").run("""%~f0"" h",vbhide)(window.close)&&exit
For /l %%i in (1,1,5) do (Ping -n 1 192.168.1.255 2>nul 1>nul&&Set /a n+=1)
If "%n%"=="5" (Start "" "C:\Program Files\1.exe"&Exit) else (Goto a)
:a
Ping -n 2 192.168.1.255 && (Start "" "C:\Program Files\1.exe") || Goto a
追问如果没找打1.exe 不就死循环了啊。
追答Ping -n 2 192.168.131.66 &&Goto b || Goto a
:b
Start "" "C:\Program Files\1.exe"
这样就不会了.