1.查看本地网卡的名称
- netsh interface show interface
复制代码 2、操作网卡命令
- 已管理员的模式运行cmd
- 关闭网卡命令:netsh interface set interface "本地连接" disabled
- 开启网卡命令:netsh interface set interface "本地连接" enabled
复制代码 3、使用bat脚本批量处理
- @echo off
- echo.
- echo 正在重启本地网卡
- netsh interface set interface "本地连接" disabled
- echo 网卡已经关闭
- netsh interface set interface "本地连接" enabled
- echo 网卡重启成功
- pause
复制代码
注意:
网卡名称就是“本地连接”· 不要使用中文,否则bat无法运行.得转编码太麻烦.
|