@echo off
REM select=1,网卡IP将被设置成172.16.200.34,select=2,网卡IP将被设置成192.168.0.5
ping -n 2 192.168.0.254 && set select=2 || set select=1
REM 获取网卡名称
for /f "skip=4 tokens=3* delims= " %%i in ('ipconfig') do (
set adapter=%%i
goto out
)

:out
set adapter=%adapter::=%
if %select%==1 (
netsh int ip set address name="%adapter%" static 172.16.200.34 255.255.255.0 172.16.200.1 1
netsh int ip set dns name="%adapter%" static 202.102.224.68 primary
netsh int ip add dns name="%adapter%" 202.102.227.68 index=2
) else (
netsh int ip set address name="%adapter%" static 192.168.0.5 255.255.255.0 192.168.0.254 1
)

echo 设置完成,按任意键退出!
pause >nul 2>nul
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com