wmic path win32_networkadapter where NetConnectionID="Local Area Connection" call disable
wmic path win32_networkadapter where NetConnectionID="Local Area Connection" call enable
甚至更详细(启动提升的命令提示符):
获取网卡列表和索引号
wmic nic get name, index
启用具有索引号的 NIC(例如:7)
wmic path win32_networkadapter where index=7 call enable
使用索引号禁用 NIC(例如:7)
wmic path win32_networkadapter where index=7 call disable
下面是 Windows XP 中的命令:
netsh interface set interface name="Local Area Connection" admin=disabled