瀏覽量:24次
@echo off
REM select=1,網(wǎng)卡IP將被設(shè)置成172.16.200.34,select=2,網(wǎng)卡IP將被設(shè)置成192.168.0.5
ping -n 2 192.168.0.254 && set select=2 || set select=1
REM 獲取網(wǎng)卡名稱
for /f "skip=4 tokens=3* delims= " %%i in ('ipconfig') do (
set adapter=%%i
goto out
)
:out
set adapter=%adapter::=%
if %select%==1 (
netsh int ip set address name="%adapter%" static 172.16.200.34 255.255.255.0 172.16.200.1 1
netsh int ip set dns name="%adapter%" static 202.102.224.68 primary
netsh int ip add dns name="%adapter%" 202.102.227.68 index=2
) else (
netsh int ip set address name="%adapter%" static 192.168.0.5 255.255.255.0 192.168.0.254 1
)
echo 設(shè)置完成,按任意鍵退出!
pause >nul 2>nul
[聲明]本網(wǎng)轉(zhuǎn)載網(wǎng)絡(luò)媒體稿件是為了傳播更多的信息,此類稿件不代表本網(wǎng)觀點,本網(wǎng)不承擔(dān)此類稿件侵權(quán)行為的連帶責(zé)任。故此,如果您發(fā)現(xiàn)本網(wǎng)站的內(nèi)容侵犯了您的版權(quán),請您的相關(guān)內(nèi)容發(fā)至此郵箱【779898168@qq.com】,我們在確認(rèn)后,會立即刪除,保證您的版權(quán)。
官網(wǎng)優(yōu)化
整站優(yōu)化
渠道代理
400-655-5776