route_listset gw=for /F "tokens=1-5" %%a in ('type route_li ; 更新日期:2024/5/20,互联网资源,高清电影,韩剧美剧,动漫资讯,游戏教程,序列号,破解版,注册机,绿色版,教程网,王者荣耀,SEO教程,网络教程,运营推广,下载中心,破解软件,游戏软件,网站源码,易语言源码,安卓软件,QQ软件,汉化版,无损音乐,MKV,WAV+CUE,FLAC,HQCD,MP3,SACD,DSD,抖音,4K高清,320k,度盘,百度云盘,蓝奏,微云盘,网盘,无广告纯净版,不限速下载,去广告,VIP解析,11" />
服务器 
首页 > 服务器 > 浏览文章

阿里云添加路由的Windows批处理文件

(编辑:jimmy 日期: 2024/5/20 浏览:3 次 )

发现一段很好的学习bat程序的示例代码,分享给大家,具体代码如下:

@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批处理文件,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!

上一篇:docker centos7 安装ssh具体步骤
下一篇:Ubuntu14.04搭建Caffe(仅CPU)详解教程
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网