用命令行禁用网卡

用命令行禁用网卡

1、首先打开电脑桌面按下键盘的win+R组合快捷键。2、然后在弹出的页面中输入 cmd 回车。3、然后即可进入命令行界面。4、然后在命令行中输入 netsh interface set interface "本地连接" disabled,回车,这样就可以禁用网卡了。5、若是想要启用的话,则输入 netsh interface set interface "无线网络连接" enabled,回车,这样就可以启用网络了。

出处:https://zhidao.baidu.com/question/553977590.html

查看可用的网卡命令:netsh lan show interfaces

查看所有网卡命令,包括已禁用的:netsh interface show interface

个人使用

禁用或启用指定网卡,保存以下代码到bat文件中,文件格式使用ANSI编码格式

@netsh lan show interfaces | find "以太网" > nul && (netsh interface set interface "以太网" disabled) || (netsh interface set interface "以太网" enabled)

@(netsh lan show interfaces | find "以太网" > nul && (netsh interface set interface "以太网" disabled && echo 以太网已禁用) || (netsh interface set interface "以太网" enabled && echo 以太网已启用))&echo,&pause

注意:

1)以上命令主要是根据匹配网络名称,也不要有:以太网1,以太网2 这样的多个网卡名称。

2)运行如下的命令,可能会提示dot3svc服务没有运行。

netsh lan show interfaces

有线自动配置服务(dot3svc)没有运行。

解决方法:

使用 sc qc dot3svc 查看实际服务名称,使用 net start dot3svc 启动 dot3svc 服务,如下图:

相关推荐

英格兰历届世界杯首场进球——英雄崛起的篇章(以进球为证,见证英格兰足球的辉煌)
wow时光徽章多久能卖出
365娱乐app官方版下载

wow时光徽章多久能卖出

📅 07-18 👁️ 6734
连续20年无缘世界杯,从“足坛流行语”看中国特色足球之路
必发365娱乐在线官网

连续20年无缘世界杯,从“足坛流行语”看中国特色足球之路

📅 01-20 👁️ 9489