DOS 配置IP地址

@echo off
:startIP
set /p source=STATIC Y or N or E:
echo source:%source%
if "%source%" == "y" ( goto staticIP )
if "%source%" == "n" ( goto dhcpIP )
if "%source%" == "e" ( goto exitSet )
:staticIP
set /p IP=IP:
echo IP:%IP%
netsh interface ip set address name="本地连接" source=static addr=%IP% mask=255.255.255.0 gateway=192.168.10.1
goto startIP
:dhcpIP
netsh interface ip set address name="本地连接" source=dhcp
goto startIP
:exitSet
exit
@Rem @netsh interface ip set dns name="本地连接" source=static addr=192.168.10.1

啦啦啦

posted @ 2017-01-18 18:51  limeOracle  阅读(433)  评论(0编辑  收藏  举报