禁用以太网连接与命令行? [英] Disabling ethernet connection with command line?

查看:470
本文介绍了禁用以太网连接与命令行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我可以这样做(在Windows 7,32& ; 64位)?

解决方案

在Windows 7中,可以使用

  wmic path win32_networkadapter其中NetConnectionID =本地连接调用禁用
wmic路径win32_networkadapter其中NetConnectionID =本地连接调用启用

即使在更详细的信息中(启动提升的命令提示符):



Get NIC列表和索引号

  wmic nic get name,index 



启用具有索引号的NIC(例如:7)

  wmic path win32_networkadapter where index = 7 call enable 

禁用具有索引编号的NIC(例如:7)

  wmic path win32_networkadapter其中index = 7 call disable 






以下是Windows XP中的命令:

  netsh接口set interface name =本地连接admin = disabled 

如果网络名称不是本地连接,请替换为您正在使用的网络。



http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/enabledisable-network-interface-via-command-line/17a21634-c5dd-4038-bc0a-d739209f5081


I have seen many 'disable wireless with command line' posts, but not about disabling ethernet.

Is it possible to do so (on Windows 7, 32 & 64 bit)?

解决方案

In Windows 7, you can use

wmic path win32_networkadapter where NetConnectionID="Local Area Connection" call disable
wmic path win32_networkadapter where NetConnectionID="Local Area Connection" call enable

Even in more details ( Start elevated Command Prompt ):

Get NIC list and index number

wmic nic get name, index

Enable NIC with index number (eg: 7)

wmic path win32_networkadapter where index=7 call enable

Disable NIC with index number (eg: 7)

wmic path win32_networkadapter where index=7 call disable


Here is the command in Windows XP:

netsh interface set interface name="Local Area Connection" admin=disabled

If the network name is not "Local Area Connection", substitute with the one you're using.

Reference: http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/enabledisable-network-interface-via-command-line/17a21634-c5dd-4038-bc0a-d739209f5081

这篇关于禁用以太网连接与命令行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆