Windows 8 and 8.1 Forums


How to Enable/Disable eth0 Interface in 8.1?

  1. #1


    Posts : 13
    Windows 8.1

    How to Enable/Disable eth0 Interface in 8.1?


    Dear Friends,

    I think I'm fighting a network permissions problem, but I'm stuck.
    I have reliable connections to my DSL modem and to the internet. I would like to enable/disable my network interface, in this case the ethernet connection to my DSL modem, (not the DSL modem connection to the phone line).

    After cruising through the Control Panel/Network and Sharing/Change Adapter Settings/ menus, I made a desktop shortcut to my Ethernet device. Right clicking on the shortcut shows a context menu with "Disable". This option works fine and cancels the connection to the modem. After that, the shortcut context menu remains the same: no option for "Enable" is shown.

    However, if I follow "Open file location" to the control panel's Network screen, the context menu for the target icon DOES contain "enable". More strange: after clicking on main Network context menu, now the desktop shortcut displays "Enable". Sometimes nothing "enables" until I run the "Diagnose" option several times with administrative priv. (I am the administrator). Any clues as to how to proceed?

    Thank You!
    IW

      My System SpecsSystem Spec

  2. #2


    Posts : 13
    Windows 8.1

    Updated Information


    A better description of a non-working desktop shortcut in Win 8.1....
    Network connections to my wired DSL modem work fine, internet connection fine. As administrator, I have made a desktop shortcut to the Control Panel\Network Connections\Ethernet Network. The context menu of the shortcut does not update to reflect the status of the network connection (computer to modem connection).

    Simply opening the Control Panel\Network Connections\Ethernet Network window (I can get there easily by choosing "Open file location") instantly updates the shortcut. The shortcut works if it is correctly updated (Enable/Disable). The shortcut is not pointing to a file as such, it indicates that the target is a long Hexadecimal number.

    I don't think this is a permissions problem, and I'm not being asked to run the shortcut as administrator. It looks like a software issue at this point. I can't think of any troubleshooting method that would help on this question. Ideas?

    Thank you,
    IceWolf
      My System SpecsSystem Spec

  3. #3

    RE: How to Enable/Disable eth0 Interface in 8.1?


    Hi IceWolf, I have the same problem. I left the shortcut and create a batch file to enable/disable it using devcon utility. Then I run it with admin privilege through the Task Scheduler.
    (This is based on this answer)
    First of all we need Microsoft's DevCon utility.
    And then the device ID. We can find it with the command "devcon find PCI*", looking for the name of our NIC or simply by looking at details tab of our network adapter in Device Manager, then selecting Hardware Ids from dropdown menu. For ex. mine is PCI\VEN_10EC&DEV_8168&SUBSYS_E0001458&REV_02 which we need the part that is in bold.
    Then copy code below into notepad and save it as connect.bat
    Code:
    @echo off
    mode con: cols=40 lines=7
    color f0
    cd /d %~dp0
    devcon status "****" > _my_status.txt
    find "running" _my_status.txt > NUL
    IF %errorlevel%==1 goto enable
    goto disable
    
    
    :enable
        title 
        echo.
        echo.
        echo.
        echo  Enabling...
        devcon enable  "****" > NUL
        timeout /t 1 /nobreak > NUL
        cls
        echo.
        echo.
        echo.
        echo  Enabled
        goto done
        
    :disable
        title 
        echo.
        echo.
        echo.
        echo  Disabling...
        devcon disable "****" > NUL
        timeout /t 1 /nobreak > NUL
        cls
        echo.
        echo.
        echo.
        echo  Disabled
        goto done
        
    :done
        timeout /t 1 /nobreak > NUL
        del _my_status.txt
        exit
    Note that replace all there **** with your device ID.
    This batch do both enabling and disabling. But that answer uses a shortcut for each one. I also do some customizations for cmd window ;)
    Finally put both devcon.exe and connect.bat in a folder and run the connect.bat

    To avoid the UAC message we can write the following code in notepad and save it as connect-SkipUAC.vbs
    Code:
    CreateObject("Wscript.Shell").Run "schtasks.exe /run /tn EthernetSkipUAC",0,True
    and put it in the same folder where devcon and connect.bat are.
    And for the last step create a new task in Task Scheduler:
    In General tab name it EthernetSkipUAC, select Run only when user is logged on and check Run with highest privilege checkbox.
    In Actions tab click New... and choose Browse... and select the file connect.bat .
    Unckeck all other checkboxes in all tabs.
    Leave the Task Scheduler and now use connect-SkipUAC.vbs instead of connect.bat. You may create a shortcut for it and choose an icon for it, too.

    At last, maybe someone has a better way or code to do instead of this long painful way, then I will use it, too.
      My System SpecsSystem Spec

  4. #4


    Posts : 13
    Windows 8.1


    Iman,
    Thanks for posting your solution to the enable/disable network. I'm truly impressed, but it is far beyond my ability. I will say that it is interesting if you look at the actual registry key that appears on a standard network device shortcut. In my case, the shortcut points to a DSL modem in the controlPanel/ethernetNetworks screen. The target of the shortcut is a registry file starting with BA126ADB... Going to that registry item, you can see a pointer to yet another registry file. That second file contains a small program which I'm sure is the enable/disable code.

    Since a registry key is a file (as someone pointed out), I should be able to make a shortcut to it just like the one on my desktop which was created by Windows. Not so easy I guess. since I can't type in that key as the target when I'm trying to create a link. I'm sure it can be done. It seems like the target of the shortcut should be the registry key that contains the enable/disable program already there. If you follow up on that idea, please let me know.

    Thanks again!
    IW
      My System SpecsSystem Spec

How to Enable/Disable eth0 Interface in 8.1?
Related Threads
I love Windows 8, except of two things. Start menu changed to a fullscreen tablet friendly interface and also the tablet friendly interface. It's great for tablets. Not so great for desktops. I have Start8 to get back the old start menu, but I just want to Disable Metro now. Other than that,...
How to Enable or Disable Pop-up Help Tips in Windows 8.1 and Windows RT 8.1 In Windows 8 and Windows RT the way to open the Charms, Start, and Switcher UIs was pretty much hidden and unknown at first unless the user just happened to stumble upon them to open them. In Windows 8.1 and Windows...
Hello all, I'm trying to launch my application directly after boot. Someone had adviced me to replace shell from "explorer.exe" to the application I want to launch. Is it the correct way for launching the application after boot. Please advice. Thanks, Narayanan K
How to Enable or Disable Store in Windows 8 and 8.1 This tutorial will show you how to enable or disable access to the Store for all or specified users in Windows 8, Windows RT, Windows 8.1, and Windows RT 8.1. You must be signed in as an administrator to be able to do the steps in this...
48543 Does anyone knows how to solved this? I couldn't even change any of this settings here in this tab. Please Help
How to Enable or Disable App Switching in Windows 8 and 8.1 This tutorial will show you how to enable or disable the App Switching options in PC settings, and the ability to switch between recent Store apps in the Switch List bar for all or specific users in Windows 8. You must be signed...
Hi Guys Please let me know how to disable DEP temporarily in Windows 8: I tried the below but did not work: C:\bcdedit /set {current} nx Always Off
Eight Forums Android App Eight Forums IOS App Follow us on Facebook