自動修改IP地址的.bat

@echo off
echo *********************
echo **自動IP修改器:IPChange **
echo *********************
echo ** [1]: 家庭自動獲取 **
echo ** [2]: 公司辦公區 **
echo ** [3]: 公司公網區 **
echo ** [4]: 保留地址(以備後用) **
echo ** [5]: 取消操做 **
echo **********************
set /p KEY= 請輸入您的選擇:
if %KEY% == 1 goto Home
if %KEY% == 2 goto Office
if %KEY% == 3 goto Public
if %KEY% == 4 goto Keep
if %KEY% == 5 goto end
if %KEY% == "" goto end
goto endide


:Home
echo Set Family's IP Start......
netsh interface ip set address name="本地鏈接" source=dhcp
netsh interface ip set dns name="本地鏈接" source=dhcp
goto enddns


:Office
echo Set Office IP start......
netsh interface ip set address name="本地鏈接" source= static addr=10.10.152.15 mask= 255.255.255.0 gateway= 10.10.152.254 gwmetric=1
netsh interface ip set dns name="本地鏈接" source=static addr=202.106.46.151 register=PRIMARY
netsh interface ip add dns name="本地鏈接" addr=202.106.195.68
netsh interface ip set wins name="本地鏈接" source=static addr=202.106.0.20 register=PRIMARY
netsh interface ip add wins name="本地鏈接" addr=202.106.195.68
goto endip


:Public
echo Set Public IP Start......
netsh interface ip set address name="本地鏈接" source= static addr=10.10.153.1 mask= 255.255.255.0 gateway= 10.10.153.254 gwmetric=1
netsh interface ip set dns name="本地鏈接" source=static addr=202.106.0.20 register=PRIMARY
netsh interface ip add dns name="本地鏈接" addr=202.106.195.68
goto endit


:Keep
echo Set Keep IP Start......
netsh interface ip set address name="本地鏈接" source= static addr=210.31.133.230 mask= 255.255.255.128 gateway= 210.31.133.129 gwmetric=1
netsh interface ip set dns name="本地鏈接" source=static addr=210.31.128.1 register=PRIMARY
netsh interface ip add dns name="本地鏈接" addr=210.31.141.1
goto endclass


:end
echo Good Luck
@echo onstatic

相關文章
相關標籤/搜索