netsh quickly enable use windows script command to disable network

netsh quickly enable use windows script command to disable network

Do not know if you have this need: the unit of the company intranet network is sometimes necessary to connect the phone hotspot wifi network, then you need to disable the network card, wireless card enabled. When connected to the network and need to disable the wireless card enabled network card. Switching back and forth like some trouble. There are no windows script command "one-click" Switch it? The answer is yes.

1. Rename card

Network Connections interface, network card, wireless card were renamed, this step is very important. Do not use the default name card, otherwise the final will prompt "This name is not registered with the router interfaces" error. Best to use English when naming avoid garbled.
Here the network card is renamed to "eth0", the wireless network card is renamed to "wifi".

2. Enable the network script commands

Save the following script command "even within the network .bat" file, placed under a folder.

netsh interface set interface "wifi" disabled
netsh interface set interface "eth0" enabled

3. Enable the external network script commands

The following command will save the script as "even outside the network .bat" file, placed under a folder.

netsh interface set interface "eth0" disabled
netsh interface set interface "wifi" enabled

Finally, the two bat files attached shortcut to the Start menu, click easy to operate.

Guess you like

Origin www.cnblogs.com/steven0325/p/11120265.html