发现一段很好的学习bat程序的示例代码,分享给大家,具体代码如下:
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | @ echo off route print -4 "10.0.0.0" | find "10.0.0.0" > route_list set gw= for /F "tokens=1-5" %%a in ( 'type route_list' ) do ( if not "%%c" == "" ( set gw=%%c ) ) if "%gw%" == "" ( echo "fail to get eth0 default gw" && goto error) route print -4 100.64.0.0 | find "%gw%" > NUL if not "%errorlevel%" == "0" ( route -p add 100.64.0.0 mask 255.192.0.0 %gw% > NUL 2>&1 ) if not "%errorlevel%" == "0" ( echo "faild to add route 100.64.0.0/10" && goto error) :success del route_list echo "add 100.64.0.0/10 success !" timeout 10 exit 0 :error timeout 10 exit 1 |
以上所述是小编给大家介绍的阿里云添加路由的Windows批处理文件,希望对大家有所帮助
版权声明:
—— 本文内容由互联网用户自发贡献, 本站不拥有所有权, 不承担相关法律责任, 如果发现本站有涉嫌抄袭的内容, 欢迎发送邮件至 :
—— 2225329841@qq.com 举报, 并提供相关证据, 一经查实, 本站将立刻删除涉嫌侵权内容。