Thursday, December 17, 2020

Netsh Network Adapter

In this tutorial, we will discuss how to view the network list from the command-line interface from the Microsoft Windows environment. At the same time, we will also discuss how to disable or enable a network interface card from the command line. In Windows, we have two separate command-line tools to work with the network adapter. One is the "Netsh" tool and the other one is the "Powershell" tool. The "Powershell" is the updated version of the "Netsh" tool. 

In this tutorial, we will learn commands using the “Netsh” tool. There is no separate window for the "Netsh" tool. The "Netsh" tool is running into the "Command Prompt" interface.

That's why to execute the "Netsh" command we will have to open the "Command Prompt" tool. From the "Run" program, use the "cmd" command to open the "Command Prompt" tool or go to the "Start" menu, then "Windows System" and click on the "Command Prompt" tool.

To view the network list using the "Netsh" tool, execute the below command:-

Netsh interface show interface

To disable the specific network interface, execute the below command:-

netsh interface set interface "Ethternet 2" disable

[Replace Ethernet 2 with your network adapter name]


To enable the network interface, execute the below command:-

netsh interface set interface "Ethternet 2" enable

[Replace Ethernet 2 with your network adapter name]


That's it. Using these commands, one administrator makes a script to reduce the administrative overhead.

No comments:

Post a Comment