@echo off
for /f "tokens=4*" %%a in ('netsh interface show interface ^| findstr "已连接"') do set "ConName=%%~a"
netsh interface ip set address name="%ConName%" source=static addr=192.168.123.123 mask=255.255.255.0 gateway=192.168.123.1 gwmetric=1
netsh interface ip set dns name="%ConName%" source=static addr=8.8.8.8
netsh interface ip add dns name="%ConName%" addr=114.114.114.114
exit
©著作权归作者所有
最新回复