for example, if I want to stop "lan connection 1" in my control pannel, I usually right click it in my control panel and disable it. Now I want to write a script to disable and enable those connections. How can I do it??
Thank you very much
for example, if I want to stop "lan connection 1" in my control pannel, I usually right click it in my control panel and disable it. Now I want to write a script to disable and enable those connections. How can I do it??
Thank you very much
I googled for you:
netsh interface set interface name="Local Area Connection" admin=disabled
put your connection name in place of "Local Area Connection"
.
More detailed syntax of netsh
:
Usage set interface [name = ] IfName
[ [admin = ] ENABLED|DISABLED [connect = ] CONNECTED|DISCONNECTED [newname = ] NewName ] Sets interface parameters. IfName - the name of the interface admin - whether the interface should be enabled (non-LAN only). connect - whether to connect the interface (non-LAN only). newname - new name for the interface (LAN only). Notes: - At least one option other than the name must be specified. - If connect = CONNECTED is specified, then the interface is automatically enabled even if the admin = DISABLED option is specified.