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

If it gives an error, download this utility (an exe) from microsoft website.

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.

    Name: Realtek RTL8139/810x Family Fast Ethernet NIC
    Hardware ID's:
    Compatible ID's:
        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&*"


Your comments are always welcome ...