@echo off
set ProxyServerValue=fetfw.fareastone.com.tw:8080
set ProxyOverrideValue="10.*,<local>"
set NetConf="local"
set TestIP="10.68.68.254"
if "%1%"=="work" goto work
if "%1%"=="home" goto home
if "%1%"=="dhcp" goto dhcp
if "%1%"=="p" goto proxy
if "%1%"=="np" goto noproxy
if "%1%"=="t" goto test
echo 命令有误,按任意退出。
pause >nul
exit
:work
set MyIP=192.168.254.31
set MyGateWay=192.168.254.254
set MyMask=255.255.255.0
set DNS1=168.95.1.1
set DNS2= 61.57.168.11
goto setip
:home
set MyIP=192.168.254.31
set MyGateWay=192.168.254.254
set MyMask=255.255.255.0
set DNS1=168.95.1.1
set DNS2= 61.57.168.11
goto setip
:dhcp
netsh interface ip set address "%NetConf%" dhcp
netsh interface ip set dns "%NetConf%" dhcp
exit
:setip
netsh interface ip set address name="%NetConf%" source=static addr=%MyIP% mask=%MyMask%
netsh interface ip set address name="%NetConf%" gateway=%MyGateWay% gwmetric=0
netsh interface ip set dns name="%NetConf%" source=static addr=%DNS1% register=PRIMARY
netsh interface ip add dns name="%NetConf%" addr=%DNS2%
netsh interface ip set wins name="%NetConf%" source=static addr=none
exit