Original article: https://answers.microsoft.com/en-us/windows/forum/windows8_1-networking/script-to-disable-enable-network-interface/8eb15e24-7d85-4a16-b42a-a874b9bb3a28


I created a batch file with the following in it:


netsh interface set interface "network_adapter_name" admin=enable && netsh interface set interface "network_adapter_name" admin=disable


Make sure to change "network_adapter_name" to the real name of the adapter like NIC1 without the quotes


  1. Press Windows key + X, click Command Prompt (Admin).
     
  2. In the elevated command prompt, copy and paste the command below, and press Enter. This will show you all network adapter names on your PC.
    netsh interface show interface
     
  3. To enable NIC type, the following command:
    netsh interface set interface "network_adapter_name" admin=enable
    (e.g netsh interface set interface "MyEthernet" admin=enable)
     
  4. To disable NIC type, the following command:
    netsh interface set interface "network_adapter_name" admin=disable
    (e.g netsh interface set interface "MyEthernet" admin=disable)
     
  5. Close the command prompt.