Shortcut to enable/disable network (wired)


  1. Posts : 9
    Windows 10 Pro x64
       #1

    Shortcut to enable/disable network (wired)


    Sorry if I missed it but it seems there is none posted under Shortcuts nor Internet & Network. I've tried searching for a solution but found no proper for Win10.
    There was at least one working in Win7 but it seems to have changed in Win10.
    I'm not looking for Wireless or Airplane just simple wired Ethernet LAN.

    Thanks in advance
    ifive


    Solved by T0mmy1977


    1. Create a batch file to execute the command below:
    2. netsh interface set interface name="Local Area Connection" admin=disabled
    3. Subsitute the actual network connection name if it isn't "Local Area Connection".
    4. Copy the batch file and change "disabled" to "enabled" for reactivation.
    5. Use "Create shortcut" on both, right-click and set "Shortcut" > "Advanced..." > "Run as administrator".
    6. Proper icons can be changed using "%SystemRoot%\system32\imageres.dll" in "Shortcut" > "Change Icon...".
    7. If you prefer white use "%SystemRoot%\system32\pnidui.dll" instead.
    Last edited by ifive; 17 Mar 2016 at 07:28. Reason: Solution
      My Computer


  2. Posts : 13,896
    Win10 Version 22H2 Pro and Home, Win11 Pro and Home
       #2

    ifive said:
    Sorry if I missed it but it seems there is none posted under Shortcuts nor Internet & Network. I've tried searching for a solution but found no proper for Win10.
    There was at least one working in Win7 but it seems to have changed in Win10.
    I'm not looking for Wireless or Airplane just simple wired Ethernet LAN.

    Thanks in advance
    ifive
    The few times I've needed to do I right-clicked the Start button, clicked Device Manager, clicked the + on Network adapters and then right-clicked the adapter to Disable or Uninstall depending upon which I needed.
      My Computers


  3. Posts : 17,838
    Windows 10
       #3

    ifive said:
    Sorry if I missed it but it seems there is none posted under Shortcuts nor Internet & Network. I've tried searching for a solution but found no proper for Win10.
    There was at least one working in Win7 but it seems to have changed in Win10.
    I'm not looking for Wireless or Airplane just simple wired Ethernet LAN.

    Thanks in advance
    ifive
    Navigate to your Network Connections page in Control Panel, right click on your adapter and create a short cut...

    Shortcut to enable/disable network (wired)-000163.png

    paste that shortcut into a custom Quick Launch folder...

    Shortcut to enable/disable network (wired)-000164.png

    which will give you a small icon on your taskbar...

    Shortcut to enable/disable network (wired)-000165.png
      My Computer


  4. Posts : 9
    Windows 10 Pro x64
    Thread Starter
       #4

    Thanks for fast replies.

    I know the long way, that's why I've started with "Shortcut ...".

    I've also tried the "Create Shortcut"-Version before by my own.
    First usage disables as expected.
    Second usage enables as expected.
    Don't ask me why any further usage during the same session tries to enable an enabled connection again and again instead of disabling it. Note that right click also offers only "Activate". And I've tried it just right now again, just in case I did something wrong by my own in the first place.
    That's the reason I'm asking for a real Shortcut - one click to disable/enable a wired Ethernet LAN, don't matter whether one or two shortcuts are necessary to fulfill the job.
      My Computer


  5. Posts : 5,442
    Windows 11 Home
       #5

    You could try NetSetMan then.
      My Computer


  6. Posts : 9
    Windows 10 Pro x64
    Thread Starter
       #6

    Thanks, I know there are some applications that can handle your connections. But that's another app that has to be running in the first place...
    As I've written, it was possible in Win7 and as far as I've read also in Win8(.1). I'm curious to know a solution in Win10.
      My Computer


  7. Posts : 36
    Windows 10 Pro x64
       #7

    I found the below Googling. You can create a batch file to execute the command below.

    netsh interface set interface name="Local Area Connection" admin=disabled
    Subsitute the actual network connection name if it isn't Local Area Connection.
    Last edited by T0mmy1977; 13 Mar 2017 at 16:55.
      My Computer


  8. Posts : 9
    Windows 10 Pro x64
    Thread Starter
       #8

    Thanks. I've found it before, too. For some curious reason I did something wrong.

    To finish the task:
    Copy the batch file and change "disabled" to "enabled" for reactivation.
    Use "Create shortcut" on both, right-click and set "Shortcut" > "Advanced..." > "Run as administrator".
    Proper icons can be changed using "%SystemRoot%\system32\imageres.dll" in "Shortcut" > "Change Icon...". If you prefer white use "%SystemRoot%\system32\pnidui.dll" instead.
      My Computer


  9. Posts : 6
    Windows 10 Pro
       #9

    Actually the network connections shortcut works if you want to disable the connection. But what if you want to enable it back? Don't know about you but I want to be able to enable it back...
    Oh, and you probably want to consider cutting off the traffic rather than disabling the connection - it takes way less time getting it back up.
      My Computer


  10. Posts : 5,442
    Windows 11 Home
       #10

    Run this command to find out your network adapter's index number:
    Code:
    wmic nicconfig get caption,index
    Then create bat shortcut with this one to disable it:
    Code:
    wmic path win32_networkadapter where index=1 call disable
    And this to enable it:
    Code:
    wmic path win32_networkadapter where index=1 call enable
    P.S. In order to avoid UAC, create an elevated shortcut.

    Create Elevated Shortcut without UAC prompt in Windows 10 | Windows 10 Tutorials
    Attached Thumbnails Attached Thumbnails Shortcut to enable/disable network (wired)-capture_06232018_154131.jpg  
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:40.
Find Us




Windows 10 Forums