杰网资源 Design By www.escxy.com

复制代码 代码如下:
@echo off
rem # ----------------------------------
rem # 接口 IP 配置       
rem # ----------------------------------

echo "=========IP 控制管理=========="
echo "=> d: 自动获取IP"
echo "=> h: 寝室 IP地址:66.168.1.8"
echo "=> r: 公司网络 IP地址:192.168.250.173"
echo "请输入对应的序号d,h,r,按回车键结束: "
set /p ch=
if %ch%==""  echo "You input null"&goto :EOF
set case=d,h,t,w>nul
echo %case%|findstr "\<%ch%\>">nul&if errorlevel 1  goto :err
goto %ch%
goto err

:h
:: "寝室"
echo "configure home ip address gateway,please wait 30 second ..."
@netsh int ip set address "本地连接" static 66.168.1.8 255.255.255.0 66.168.1.1 1 >nul
@netsh int ip set dns  "本地连接"  static  66.168.1.1  PRIMARY >nul
echo home ip configure is done
goto :EOF

:r
:: "公司网络"
echo "configure transport ip address gateway,please wait 30 second ..."
@netsh int ip set address "本地连接" static 192.168.250.173 255.255.255.0 192.168.250.1 1 >nul
echo transport ip configure is done
goto :EOF

:d
:DHCP "自动获取IP地址"
echo "configure transport ip address gateway,please wait 30 second ..."
@netsh int ip set address "本地连接"  dhcp >nul
@netsh int ip set dns  "本地连接"  dhcp   >nul

:err
:: "error"
echo your input "%ch%" ,no this argument ! please input h or w!  game over
rem # 接口 IP 配置结束

标签:
ip地址切换,批处理脚本

杰网资源 Design By www.escxy.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
杰网资源 Design By www.escxy.com