快捷更改IP配置.bat腳本

@echo offspa

: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 exitdns

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

: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 & exitit

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

相關文章
相關標籤/搜索