本帖最后由 lancer 于 2023-5-4 16:53 编辑
使用管理员权限运行批处理。- @echo off
- :start
- echo,选项1:启用有线网络,关闭WiFi网络;
- echo,选项2:启用WiFi网络,关闭有线网络;
- echo,选项3:重启有线网络;
- echo,选项4:同时启用有线网络和WiFi网络
- echo,选项5:退出批处理
- choice /c 12345
- if %errorlevel% equ 5 goto :eof
- if %errorlevel% equ 4 goto way
- if %errorlevel% equ 3 goto cq
- if %errorlevel% equ 2 goto wifi
- if %errorlevel% equ 1 goto you
-
- :you
- netsh interface set interface "lan" enable
- netsh interface set interface "wlan" disable
- goto :start
-
- :wifi
- netsh interface set interface "lan" disable
- netsh interface set interface "wlan" enable
- goto :start
-
- :cq
- netsh interface set interface "lan" disable
- netsh interface set interface "lan" enable
- goto :start
-
- :way
- netsh interface set interface "lan" enable
- netsh interface set interface "wlan" enable
- goto :start
复制代码
|