Here comes……
Preface: Because I need to disable and enable the network card under batch processing, I specially found a lot of such posts. There are also many people on the Internet who write statements like netsh interface set interface "Local Area Connection" "disabled" to say that it can be disabled, but in fact---------using netsh cannot successfully disable the network card. At least I have tried for N hours and it is not successful. Fortunately, I found--------devcon.exe, this small thing developed by Microsoft. Although it is not very intelligent, it solves the problem to a certain extent. Now let's talk about the outline of it:
The DevCon utility is a command-line utility that can replace Device Manager. With DevCon, you can enable, disable, restart, update, delete, and query a single device or a group of devices. DevCon also provides information related to driver developers that cannot be seen in Device Manager.
DevCon can be used for Microsoft Windows 2000, Windows XP, and Windows Server 2003, but it cannot be used for Windows 95, Windows 98, or Windows Millennium Edition.
General usage: (Introduce several common commands and grammars)
1. devcon find
devcon find *
devcon find pci\*
2. devcon disable *msloop
3. devcon enable '*MSLOOP
is really an asterisk, not a wildcard]
4. devcon remove @usb\*
Delete all USB devices. The deleted devices will display their deletion status when listed
Because an example will be talked about below, so first talk about what the hardware ID is, to be honest, it is to let everyone know how to find it. Please see:
find pci\* The following is part of what is found:
PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\3&13C0B0C5&0&58: Realtek RTL8139 Family PCI Fast Ethernet NIC
PCI\VEN_1106&DEV_0571&SUBSYS_18271019&REV_06\3&13C0B0C5&0&89: VIA Bus Master IDE Controller
PCI\VEN_1106&DEV_3038&SUBSYS_18271019&REV_80\3&13C0B0C5&0&80: VIA Rev 5 or later USB Universal Host Controller
The part before ":" in these lines is the hardware ID, and the part after is the device name.
I am going to disable the network card, please see carefully:
devcon disable *DEV_8139*
I am going to enable it, do the same: devcon enable *DEV_8139*
If you specify -r and need to restart, then after processing all devices, it will restart without any warning messages. Other things will not be said much. If you like to use it, go and download a compressed package to use on your own computer. Some people may think that if it has more powerful functions, please rely on yourself... Believe in yourself!
There are 2 folders in the compressed package, one for 32-bit use and one for 64-bit use,
The DevCon.exe file contains the following files:
File Description
I386\DevCon.exe Binary file of the 32-bit DevCon tool. This file does not function fully on 64-bit Windows.
Ia64\DevCon.exe Binary file of the 64-bit DevCon tool.
Download address:
http://download.microsoft.com/download/1/1/f/11f7dd10-272d-4cd2-896f-9ce67f3e0240/devcon.exe
[
Last edited by flying008 on 2006-7-21 at 13:49 ]