码迷,mamicode.com
首页 > 其他好文 > 详细

快捷更改IP配置.bat脚本

时间:2015-01-31 12:06:33      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:

@echo off

:list
echo 1. 动态
echo 2. 静态
echo 3. DHCP
echo 4. exit
echo 请选择序号:...
set /p n=
if %n% == 1 goto staticIP
if %n% == 2 goto dynamicIP
if %n% == 3 goto dhcp
if %n% == 4 exit

:staticIP
echo qinshi is here
netsh interface ip set address name="本地连接" source=dhcp
netsh interface ip set dns name="本地连接" source=dhcp
pause & exit

:dynamicIP
echo qiming is here
netsh interface ip set address name="本地连接" source=static addr=192.168.10.201 mask=255.255.255.0 gateway=192.168.10.254 gwmetric=1
netsh interface ip set dns name="本地连接" source=static addr=8.8.8.8 register=primary
netsh interface ip add dns name="本地连接" addr=202.114.0.242 index=2
echo ip:192.168.10.201
pause & exit

:dhcp
echo dhcp is here
netsh interface ip set address name="本地连接" source=dhcp
pause & exit

快捷更改IP配置.bat脚本

标签:

原文地址:http://www.cnblogs.com/goAhead-hust/p/4263821.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!