@echo off
echo 正在设置网络接口...
rem 遍历所有网络接口
for /f "tokens=5" %%a in ('netsh interface ipv4 show interfaces') do (
set "interface=%%a"
setlocal enabledelayedexpansion
echo !interface!
rem 设置接口为自动获取IP地址
netsh interface ipv4 set address "!interface!" dhcp
netsh interface ipv4 set dns "!interface!" dhcp
netsh interface set interface "!interface!" admin=disable
timeout /t 5
netsh interface set interface "!interface!" admin=enable
endlocal
)
echo 设置完成!
netsh winsock reset
netsh int ip reset c:/catalog.txt
netsh winhttp reset proxy
netsh advfirewall reset
ipconfig /flushdns
ipconfig /release
ipconfig /renew