Can I enable/disable a network connection from the command-line or MS-Dos?

空扰寡人 提交于 2020-01-24 21:12:47

问题


I want to enable/disable a network connection from the command-line in Windows 8.

netsh interface set interface “Local Area Connection” DISABLED 

To enable the interface, you'd then run:

netsh interface set interface “Local Area Connection” ENABLED 

When I try this, it generates an error message which states that "no more data is available".


回答1:


This works for me:

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




回答2:


This may be enough for you if you are using DHCP.

Disable:

ipconfig /release *

Enable:

ipconfig /renew


来源:https://stackoverflow.com/questions/23485848/can-i-enable-disable-a-network-connection-from-the-command-line-or-ms-dos

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!