if "%choice%"=="1" goto ip1
if "%choice%"=="2" goto ip2
if "%choice%"=="3" goto ie3
if "%choice%"=="4" goto ie4
if "%choice%"=="5" goto ip5
if "%choice%"=="6" goto end
netsh interface ip set address "%INTERFACE%" static %IP% %MASK% %GATEWAY% 0
netsh interface ip add address "%INTERFACE%" %IP2% %MASK2% %GATEWAY2% 0
netsh interface ip set dns "%INTERFACE%" static %DNS1% PRIMARY
netsh interface ip add dns "%INTERFACE%" %DNS2% index=2
@echo 设置完毕,自动退出!
exit
:ip2
echo IP自动设置开始....
echo.
echo 自动获取IP地址....
@rem win7: name="本地连接" win8: name = "以太网"
netsh interface ip set address name = "以太网" source = dhcp
echo 自动获取DNS服务器....
netsh interface ip set dns name = "以太网" source = dhcp
@echo 设置完毕,自动退出!
exit