How to Enable/Disable eth0 Interface in 8.1?

IceWolf

New Member
Messages
14
Location
Melissa, TX
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 Computer

System One

  • OS
    Windows 8.1
    Computer type
    PC/Desktop
    System Manufacturer/Model
    None
    CPU
    AMD Athlon X2
    Motherboard
    Asus M3A78
    Memory
    2 gig
    Graphics Card(s)
    NVIDIA GeForce 8400
    Browser
    FF
    Antivirus
    Comodo
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 Computer

System One

  • OS
    Windows 8.1
    Computer type
    PC/Desktop
    System Manufacturer/Model
    None
    CPU
    AMD Athlon X2
    Motherboard
    Asus M3A78
    Memory
    2 gig
    Graphics Card(s)
    NVIDIA GeForce 8400
    Browser
    FF
    Antivirus
    Comodo
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 Computer

System One

  • OS
    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 Computer

System One

  • OS
    Windows 8.1
    Computer type
    PC/Desktop
    System Manufacturer/Model
    None
    CPU
    AMD Athlon X2
    Motherboard
    Asus M3A78
    Memory
    2 gig
    Graphics Card(s)
    NVIDIA GeForce 8400
    Browser
    FF
    Antivirus
    Comodo
Back
Top