Jun 22, 2011

Enable/Disable LAN interface by command prompt in Windows XP

First thing you need to check "devcon" is working in your XP version.
Go to command prompt and type
C:\>devcon

If it gives an error, download this utility (an exe) from microsoft website.
http://download.microsoft.com/download/1/1/f/11f7dd10-272d-4cd2-896f-9ce67f3e0240/devcon.exe

Extract that into a known place and change your command prompt path to that folder where the .exe file exist.

Now if you type condev it should give a help details.

Now you need to get the Ethernet name from that command. To do that type;

C:\devcon_folder> devcon hwids "PCI\*"  >pcidevname.txt

This will print all PCI devices hardware details into that text file. So go through that text file and get the ID of your ethernet card. (Use Ctrl+F and key word "Ethernet")

It will be like this.


PCI\VEN_10EC&DEV_8139&SUBSYS_10451043&REV_10\4&2966AB86&0&38A4
    Name: Realtek RTL8139/810x Family Fast Ethernet NIC
    Hardware ID's:
        PCI\VEN_10EC&DEV_8139&SUBSYS_10451043&REV_10
        .......
    Compatible ID's:
        PCI\VEN_10EC&DEV_8139&REV_10
        PCI\VEN_10EC&DEV_8139 ......


Get your ID equal to "PCI\VEN_10EC&*"

Then type to disable;

C:\devcon_folder>devcon disable "PCI\VEN_10EC&*"

To enable

C:\devcon_folder>devcon enable "PCI\VEN_10EC&*"

1 comment:

Your comments are always welcome ...