@echo off
cls
:menu
echo IP切換選擇菜單
echo ----------------------------------------
echo 1.自動獲取IP;
echo 2.設(shè)置校園網(wǎng)絡(luò)IP;
echo ----------------------------------------
set /p input=根據(jù)您的需要,請輸入數(shù)字,進(jìn)行選擇:
if %input%==1 goto Item01
if %input%==2 goto Item02
:Item01
::Todo here
@echo off
cls
echo 您的選擇為:自動獲取IP……
rem eth //設(shè)置網(wǎng)卡名稱,如"本地連接"
set eth="本地連接"
netsh interface ip set address "%eth%" source=dhcp
netsh interface ip set dns "%eth%" source=dhcp
ipconfig /flushdns
cls
exit
:Item02
::Todo here
@echo off
cls
echo 您的選擇為:設(shè)置校園網(wǎng)絡(luò)IP……
netsh interface IP set address name="本地連接" source=static addr=192.168.0.79 mask=255.255.255.0
netsh interface IP set address name="本地連接" gateway=192.168.0.1 gwmetric=0
netsh interface IP set dns name="本地連接" source=static addr=202.114.0.242 register=PRIMARY
netsh interface IP add dns name="本地連接" addr=202.112.20.131 index=2
netsh interface IP set wins name="本地連接" source=static addr=none
ipconfig /flushdns
cls
exit
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點(diǎn)擊舉報(bào)。