≡ Menu

How to Disable LAN connection from CMD

If you want to disable LAN connection from Windows command prompt, you can run the following steps.

  1. Open elevated command prompt
  2. Run the below command
    netsh interface set interface name="Local Area Connection" admin=DISABLED

    Disable LAN connection from command prompt
    That’s all you need to do. Now you may open ‘Network connections’ and confirm that the connection is disabled.

You can also use netsh command to check the connection status.

C:\>netsh interface show interface
Admin State    State          Type             Interface Name
-------------------------------------------------------------------------
Disabled       Disconnected   Dedicated        Local Area Connection 2
Enabled        Connected      Dedicated        Wireless Network Connection
Disabled       Disconnected   Dedicated        Local Area Connection

The output for the above netsh command shows that LAN connection is turned off.

11 comments… add one
  • Abhishek Gujrati

    how to enable it?

    • Dude

      Replace disabled by enabled…

  • Paul

    This trick only worked when I opened the command prompt “Run as Administrator”

    • Kris256

      Correct, It will only work within an elevated command prompt. Just as if a limited user was in the network connections menu they would not be able to disable the lan without administrative privileges which is why it escalates with uac.

  • xan

    how i do it without admins privileges??? is even possible?

  • Shane Toumey

    I could never get this to work. The command goes through without showing an error (maybe there’s something in Event Viewer, but I never looked), but in my experience, the NIC remains enabled.

    I ended up using a WMIC command from another site.

  • Pat

    If you’re stuck during Windows setup you can press Shift+F10 to bring up the command prompt and use this to avoid creating a Microsoft account.

  • Anil Farhan

    thank you, but what about Domain users?

  • Robb

    We can use this command for Windows 7 8 10
    set interface name=”Wired Ethernet Connection” admin=DISABLED

  • Dante Sparda

    i wanna add this to a notepad ( Bat file) and execute it but it not working, any ideas? as i have to switch between Lan and wifi all the time.

    C:\Windows\system32>netsh interface set interface name=”Ethernet” admin=DISABLED

    • J

      run as administrator

Leave a Comment