9

Currently, when I need to disable/enable network adapter I'm performing the following steps:

  1. Opening the device manager (⊞ Win+R, devmgmt.msc and Enter).
  2. Searching for the required network adapter.
  3. Click right mouse button on it.
  4. Select Disable (or Enable) from the popup menu: enter image description here

How I can disable/enable network adapter from the command line?

Thanks

3 Answers 3

9

Open up Command Prompt as Administrator and type the following command line:

netsh interface set interface 'INTERFACE NAME' disable

References:

How to enable or disable Wi-Fi and Ethernet network adapters on Windows 10

0
6

Open up PowerShell as Administrator and run the following:

Get-NetAdapter

Get-NetAdapter will list the Network adapter properties

Get-NetAdapter Documentation

Disable a network adapter by name

Disable-NetAdapter -Name "Adapter Name" -Confirm:$false

Disable-NetAdapter Documentation

Enable Network Adapter by Name

Enable-NetAdapter -Name "Adapter Name" -Confirm:$false

Enable Net Adapter Documentation

0
-1

script to enable and disable network adapter

hi, use the below script and save it as .bat file.ex.. (lan.bat) please change the interface name cmd > netsh interface show interface (this command will show your interface name)

copy below script to notepad and save it as .bat file as said above @echo off (netsh interface show interface name="your interface name" | find /i "enabled")>nul if %errorlevel% equ 0 (netsh interface set interface name="your interface name" admin=disabled) else (netsh interface set interface name="your interface name" admin=enabled)

1
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Sep 6, 2023 at 8:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .