- @echo off
- wmic nic where "NetConnectionID='以太网'" get NetEnabled|find /i "TRUE"
- if errorlevel 1 (
- netsh interface set interface "WLAN" Disabled
- netsh interface set interface "以太网" Enabled
- ) else (
- netsh interface set interface "以太网" Disabled
- netsh interface set interface "WLAN" Enabled
- )
- pause
复制代码
|