问题
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