用命令如何禁用再开启网卡?

2025-02-25 18:04:51
推荐回答(2个)
回答1:

可以用netsh interface set interface "你网卡的名字" disabled 命令禁用网卡,netsh interface set interface "你网卡的名字" enable开启网卡,具体操作如下:

一、打开控制面板 - 网络和Internet - 更改适配器设置中找到你网卡的名字,如下图我网卡的名字就是以太网。

二、用WIN + R 输入CMD打开命令行(注意必须用管理员权限),也可以做成.bat文件,输入netsh interface set interface "以太网" disabled ,注意不加双引号也是可以的。

三、再次打开适配器设置查看网卡已经禁用。

四、启用网卡netsh interface set interface "你网卡的名字" enable

回答2:

禁用网卡: netsh interface set interface "本地连接" disabled
启用网卡 : netsh interface set interface "本地连接" enabled

注意:本地连接就是你网卡的连接名。比如你的是本地连接2 上面命令就改为本地连接2。