@echo off
netsh interface show interface "以太网" | find "管理状态: 已启用" >nul && (
echo connected - disconnecting...
netsh interface set interface "以太网" disabled
netsh interface set interface "WLAN" enable
echo 当前为WLAN
) || (
echo disconnected - connecting
netsh interface set interface "以太网" enabled
netsh interface set interface "WLAN" disable
echo 当前为以太网
)
pause
exit
将上面的脚本复制到文本中,重命名文本为xx.bat,有线网络和无线网络一键切换