HOWTO: Enable, Disable or Restart Network Adapter

Very often, when working on a remote site, you must distort the network cable or disconnect and enable the network adapter. But since we cannot do this physically, we have to ask someone to do it or to excel in such ways. In Linux, this happens easily, via ssh we drive in ifdown eth0 & ifup eth0 and all the rules. In Windows, you have to do the following to restart the network adapter

1. Disable or Enable the Network Adapter in Network Connections

In the search bar or in the execute menu, type control.exe / name Microsoft.NetworkAndSharingCenter and press the Enter key (or go to the Start menu => Settings => Network and Internet => Status => Adapter settings").

Step 1 to Disable or Enable the Network Adapter is to control name Microsoft NetworkAndSharingCenter

On the left side, click on "Change adapter settings."

Step 2 to Disable or Enable the Network Adapter is to Change adapter settings

To disable the network connection: select the network adapter that you want to disable and click on "Disable this network device" (or right-click on the network connection and select Disable).

disable the network connection

To enable the network connection: select the network adapter you want to enable, and click on "Enable this network device" (or right-click on the network connection and select "Enable").

Enable this network device

2. Disable or Enable the Network Adapter in Device Manager

Open the "Device Manager": one of the ways is to execute in the search bar or in the menu (Run is called with the Win + R keys) enter the command devmgmt.msc and press the Enter key.

To Disable or Enable the Network Adapter is to open devmgmt

To disable the network connection: open "Network adapters", right-click on the one you want to disable, and click on "Disable device". In the window that appears, click on "Yes."

Disable network device

To enable a network connection: open "Network adapters", right-click on the one you want to enable, and click on "Enable device".

enable network device

3. Disable or Enable the Network Adapter Using the WMIC Command

Open a command prompt as administrator: one way is to enter cmd in the search bar and right-click on the result found, select "Run as administrator".

To Disable or Enable the Network Adapter is to Open Command line

Type wmic nic get name, index and press Enter. Opposite the name of the network adapter that you need to enable or disable is the index that you need to remember.

To Disable or Enable the Network Adapter is to Open Command line

To disable a network adapter, use command wmic path win32_networkadapter where index = 1 call disable

Use command wmic path win32 networkadapter where index

To enable the network adapter, use command wmic path win32_networkadapter where index = 1 call enable

4. Restart Network Adapter with Bat-file

Create a bat-file, enter the following script there necessarily in ANSI encoding:
netsh interface set interface name = "Local Area Connection" admin = DISABLED
ping 127.0.0.1 -n 6> nul
netsh interface set interface name = "Local Area Connection" admin = ENABLED

Run this bat-file as administrator.
where "Local Area Connection" is the name of the network adapter in your Windows. It may be called "Local Area Connection 2" or "Local Area Connection 3". For convenience, I renamed the connections to LAN, WiFi, Internet, Router or Bluetooth.
Remarks: works not only in Windows 7, but also in Windows 8 and Windows 10.

Also consider using Action1 to restart the network adapter if:

  • - You need to perform this action on multiple (hundreds or even thousands) computers simultaneously.
  • - Some of your endpoints are laptops not connected to corporate network at all times.

Action1 is a cloud-based platform for software deployment, software/hardware inventory, patch management, endpoint configuration and more. It is free with basic functionality.


Other Relevant HOWTOs: