Device Console (DevCon - Exe) Examples - Windows Drivers Microsoft Docs
Device Console (DevCon - Exe) Examples - Windows Drivers Microsoft Docs
DevCon HwIDs
Example 1: Find all hardware IDs
DevCon Classes
Example 4: List classes on the local computer
DevCon ListClass
Example 6: List the devices in a device setup class
DevCon DriverFiles
Example 8: List all driver files
DevCon DriverNodes
Example 10: List driver packages by hardware ID pattern
DevCon Resources
Example 12: List resources of a class of devices
DevCon Stack
Example 14: Display the driver stack for storage devices
Example 16: Display the stack for related devices on a remote computer
DevCon Status
Example 17: Display the status of all devices on the local computer
DevCon Find
Example 20: Find devices by hardware ID pattern
DevCon FindAll
Example 22: Find (and find all) devices in a setup class
DevCon ClassFilter
Example 23: Display the filter drivers for a setup class
DevCon Enable
Example 28: Enable a particular device
DevCon Disable
Example 30: Disable devices by an ID pattern
DevCon Install
Example 33: Install a device
DevCon Remove
Example 35: Remove devices by device instance ID pattern
DevCon Rescan
Example 37: Scan the computer for new devices
DevCon Restart
Example 38: Restart a device
DevCon Status
Example 39: Reboot the local computer
DevCon SetHwID
Example 40: Assign a hardware ID to a legacy device
Example 42: Delete a hardware ID from all legacy devices on a remote computer
The following command uses the DevCon HwIDs operation, which returns the IDs and
the device description. It uses the wildcard character (*) to represent all devices on the
local computer.
= Copier
devcon hwids *
Because the output is lengthy and used repeatedly, save the output in a text file for
reference.
The following command uses the wildcard character (*) to represent all devices on the
computer. It uses the redirection character (>) to save the command output in the
hwids.txt file.
= Copier
The following command finds the hardware IDs of devices on a remote computer,
Server01. It uses the /m parameter to specify the name of the remote computer. The
command redirects the output to the server01_hwids.txt file for later reference.
Note This command fails unless the user has the required permissions on the remote
computer. To run DevCon commands on a remote computer, the Group Policy setting
must allow the Plug and Play service to run on the remote computer. On computers that
run Windows Vista and Windows 7, the Group Policy disables remote access to the
service by default. On computers that run Windows Driver Kit (WDK) 8.1 and Windows
Driver Kit (WDK) 8, the remote access is unavailable.
= Copier
The following command uses the DevCon HwIDs operation and a pattern to find the
hardware IDs of the floppy disk drive on the computer. (The user assumes that the
pattern appears in one of the device identifiers.) The command uses the wildcard
character (*) to represent all characters that might precede or follow the word "floppy"
in any of the IDs.
= Copier
In response, DevCon displays the device instance ID, hardware ID, and compatible ID of
the floppy disk drive on the computer. You can use these IDs in subsequent DevCon
commands.
= Copier
FDC\GENERIC_FLOPPY_DRIVE\5&39194F6D&0&0
Name: Floppy disk drive
Hardware ID's:
FDC\GENERIC_FLOPPY_DRIVE
Compatible ID's:
GenFloppyDisk
1 matching device(s) found.
In this case, the phrase "floppy" occurs in the hardware ID or compatible ID of only one
device on the computer. If it occurs in the ID of more than one device, all devices with
"floppy" in their IDs appear in the output.
= Copier
In response, DevCon displays the hardware IDs and compatible IDs of the three devices
in the Ports setup class.
= Copier
ACPI\PNP0401\4&B4063F4&0
Name: ECP Printer Port (LPT1)
Hardware ID's:
ACPI\PNP0401
*PNP0401
ACPI\PNP0501\1
Name: Communications Port (COM1)
Hardware ID's:
ACPI\PNP0501
*PNP0501
ACPI\PNP0501\2
Name: Communications Port (COM2)
Hardware ID's:
ACPI\PNP0501
*PNP0501
3 matching device(s) found.
The following command uses the DevCon Classes operation, which returns a list and
description of all classes on the computer.
= Copier
devcon classes
Because the output is lengthy and used repeatedly, save the output in a text file for
reference.
The following command displays all device classes on the computer. It uses the
redirection character (>) to save the command output in the classes.txt file.
= Copier
= Copier
Because the output is lengthy and used repeatedly, save the output in a text file for
reference.
The following command uses the redirection character (>) to save the command output
in the server01_classes.txt file.
= Copier
= Copier
In response, DevCon displays the device instance ID and description of each device in
the Net setup class.
= Copier
(PPPOE)
ROOT\MS_PPTPMINIPORT\0000 : WAN Miniport
(PPTP)
ROOT\MS_PTIMINIPORT\0000 : Direct
Parallel
This display, although interesting, does not provide the hardware IDs of the devices in
the Net setup class. The following command uses the DevCon HwIDs operation to list
the devices in the Net setup class. In a DevCon HwIDs command, the class name is
preceded by an equal sign (=) to indicate that it is a class, not an ID.
= Copier
The resulting display lists the devices in the Net class and includes the device instance
ID, hardware IDs, and compatible IDs of devices in the class.
= Copier
PCI\VEN_10B7&DEV_9200&SUBSYS_00BE1028&REV_78\4&BB7B4AE&0&60F0
Name: 3Com 3C920 Integrated Fast Ethernet Controller (3C905C-TX
Compatible)
Hardware ID's:
PCI\VEN_10B7&DEV_9200&SUBSYS_00BE1028&REV_78
PCI\VEN_10B7&DEV_9200&SUBSYS_00BE1028
PCI\VEN_10B7&DEV_9200&CC_020000
PCI\VEN_10B7&DEV_9200&CC_0200
Compatible ID's:
PCI\VEN_10B7&DEV_9200&REV_78
PCI\VEN_10B7&DEV_9200
PCI\VEN_10B7&CC_020000
PCI\VEN_10B7&CC_0200
PCI\VEN_10B7
PCI\CC_020000
PCI\CC_0200
ROOT\MS_L2TPMINIPORT\0000
Name: WAN Miniport (L2TP)
Hardware ID's:
ms_l2tpminiport
ROOT\MS_NDISWANIP\0000
Name: WAN Miniport (IP)
Hardware ID's:
ms_ndiswanip
ROOT\MS_PPPOEMINIPORT\0000
Name: WAN Miniport (PPPOE)
Hardware ID's:
ms_pppoeminiport
ROOT\MS_PPTPMINIPORT\0000
Name: WAN Miniport (PPTP)
Hardware ID's:
ms_pptpminiport
ROOT\MS_PTIMINIPORT\0000
Name: Direct Parallel
Hardware ID's:
ms_ptiminiport
6 matching device(s) found.
= Copier
In response, DevCon displays the devices in those classes on the remote computer.
= Copier
= Copier
= Copier
In response, DevCon displays the two device drivers that support the mouse device.
= Copier
HID\VID_045E&PID_0039\6&DC36FDE&0&0000
Name: Microsoft USB IntelliMouse Optical
Driver installed from c:\windows\inf\msmouse.inf [HID_Mouse_Inst]. 2
file(s)
used by driver:
C:\WINDOWS\System32\DRIVERS\mouhid.sys
C:\WINDOWS\System32\DRIVERS\mouclass.sys
1 matching device(s) found.
The following command uses the ID pattern sw\* to specify devices whose hardware IDs
or compatible IDs begin with "sw," that is, software-enumerated devices.
= Copier
= Copier
SW\{A7C7A5B0-5AF3-11D1-9CED-00A024BF0407}\{9B365890-165F-11D0-
A195-0020AFD156E4}
= Copier
In response, DevCon displays the driver nodes of devices whose device instance ID
begins with "ROOT\MEDIA."
= Copier
ROOT\MEDIA\MS_MMACM
Name: Audio Codecs
DriverNode #0:
Inf file is c:\windows\inf\wave.inf
Inf section is MS_MMACM
Driver description is Audio Codecs
Manufacturer name is (Standard system devices)
Provider name is Microsoft
Driver date is 7/1/2001
Driver version is 5.1.2535.0
Driver node rank is 0
Driver node flags are 00002240
Inf is digitally signed
ROOT\MEDIA\MS_MMDRV
Name: Legacy Audio Drivers
DriverNode #0:
Inf file is c:\windows\inf\wave.inf
Inf section is MS_MMDRV
Driver description is Legacy Audio Drivers
Manufacturer name is (Standard system devices)
The following command uses the DevCon Resources operation to display the resources
allocated to devices in the Hdc device setup class. This class includes IDE controllers. The
equal sign (=) is prepended to "hdc" to indicate that it is a class and not an ID.
= Copier
In response, DevCon lists the resources allocated to IDE controllers on the local
computer.
= Copier
PCI\VEN_8086&DEV_244B&SUBSYS_00000000&REV_02\3&29E81982&0&F9
Name: Intel(r) 82801BA Bus Master IDE Controller
Device is currently using the following resources:
IO : ffa0-ffaf
PCIIDE\IDECHANNEL\4&37E53584&0&0
Name: Primary IDE Channel
Device is currently using the following resources:
IO : 01f0-01f7
IO : 03f6-03f6
IRQ : 14
PCIIDE\IDECHANNEL\4&37E53584&0&1
Name: Secondary IDE Channel
Device is currently using the following resources:
IO : 0170-0177
IO : 0376-0376
IRQ : 15
3 matching device(s) found.
= Copier
= Copier
ROOT\*PNP0100\PNPBIOS_8
Name: System timer
Device has the following resources reserved:
IO : 0040-005f
IRQ : 0
1 matching device(s) found on \\server01.
The following command uses the device instance ID of the remote system timer in the
DevCon resources command. The at character (@) indicates that the string is a device
instance ID, not a hardware ID or compatible ID.
= Copier
= Copier
In response, DevCon displays the expected stack for the devices in the Volume class. The
returned data includes the device instance ID and description of each device, the GUID
and name of the device setup class, the names of upper and lower filter drivers, and
controlling services (if any).
= Copier
STORAGE\VOLUME\1&30A96598&0&SIGNATURE32323533OFFSET271167600LENGTH6E00D0C00
Name: Generic volume
Setup Class: {71A27CDD-812A-11D0-BEC7-08002BE2092F} Volume
Class upper filters:
VolSnap
Controlling service:
(none)
STORAGE\VOLUME\1&30A96598&0&SIGNATURE32323533OFFSET7E00LENGTH27115F800
Name: Generic volume
Setup Class: {71A27CDD-812A-11D0-BEC7-08002BE2092F} Volume
Class upper filters:
VolSnap
Controlling service:
(none)
2 matching device(s) found.
The following command uses the DevCon HwIDs operation to find the device instance
ID of the printer port interface by using "LPT," a phrase in the printer port hardware ID.
= Copier
In response, DevCon returns the device instance ID (displayed in bold text) and the
hardware ID of the printer port interface.
= Copier
LPTENUM\MICROSOFTRAWPORT\5&CA97D7E&0&LPT1
Name: Printer Port Logical Interface
Hardware ID's:
LPTENUM\MicrosoftRawPort958A
MicrosoftRawPort958A
1 matching device(s) found.
The next command uses the DevCon Stack operation to find the device setup class of
the device represented by the device instance ID. An at character (@) identifies the ID as
a device instance ID. The ID is enclosed in quotation marks because it includes
ampersand characters.
= Copier
In response, DevCon displays the driver stack for the printer port interface, including the
class. The display reveals that the printer port is in the System class.
= Copier
LPTENUM\MICROSOFTRAWPORT\5&CA97D7E&0&LPT1
Name: Printer Port Logical Interface
Setup Class: {4D36E97D-E325-11CE-BFC1-08002BE10318} System
Controlling service:
(none)
1 matching device(s) found.
Note that this command first limits the search to the Net setup class and then finds the
"miniport" string. It does not find devices other than those in the Net setup class.
= Copier
In response, DevCon displays the expected stack for miniport drivers on Server01.
= Copier
ROOT\MS_L2TPMINIPORT\0000
Name: WAN Miniport (L2TP)
Setup Class: {4D36E972-E325-11CE-BFC1-08002BE10318} Net
Controlling service:
Rasl2tp
ROOT\MS_PPPOEMINIPORT\0000
Name: WAN Miniport (PPPOE)
Setup Class: {4D36E972-E325-11CE-BFC1-08002BE10318} Net
Controlling service:
RasPppoe
Lower filters:
NdisTapi
ROOT\MS_PPTPMINIPORT\0000
Name: WAN Miniport (PPTP)
Setup Class: {4D36E972-E325-11CE-BFC1-08002BE10318} Net
Controlling service:
PptpMiniport
Lower filters:
NdisTapi
ROOT\MS_PTIMINIPORT\0000
Name: Direct Parallel
Setup Class: {4D36E972-E325-11CE-BFC1-08002BE10318} Net
Controlling service:
Raspti
Lower filters:
PtiLink
4 matching device(s) found on \\Server01.
= Copier
The following command uses the device instance ID of the I/O controller on the local
computer in a DevCon Status command. The command includes the device instance ID
of the device, PCI\VEN_8086&DEV_1130&SUBSYS_00000000&REV_02
= Copier
= Copier
PCI\VEN_8086&DEV_1130&SUBSYS_00000000&REV_02\3&29E81982&0&00
Name: Intel(R) 82815 Processor to I/O Controller - 1130
Driver is running.
1 matching device(s) found.
Volumes, STORAGE\Volume
In the command, each ID is separated from the others by spaces. Note that GenDisk and
GenCdRom are compatible IDs, whereas the other IDs are hardware IDs.
= Copier
= Copier
FDC\GENERIC_FLOPPY_DRIVE\1&3A2146F1&0&0
Name: Floppy disk drive
Driver is running.
IDE\CDROMSAMSUNG_DVD-ROM_SD-608__________________2.2_____\4&13B4AFD&0&0.0.0
Name: SAMSUNG DVD-ROM SD-608
Driver is running.
IDE\DISKWDC_WD204BA_____________________________16.13M16
\4457572D414D373032313633393820312
0202020
Name: WDC WD204BA
Driver is running.
ROOT\DMIO\0000
Name: Logical Disk Manager
Driver is running.
ROOT\FLOPPYDISK\0000
Device has a problem: 28.
ROOT\FLOPPYDISK\0002
Device has a problem: 01.
ROOT\FLOPPYDISK\0003
Device has a problem: 01.
ROOT\FLOPPYDISK\0004
Device is currently stopped.
ROOT\FTDISK\0000
Name: Volume Manager
Driver is running.
STORAGE\VOLUME\1&30A96598&0&SIGNATUREEA1AA9C7OFFSET1770DF800LENGTH3494AEA00
Name: Generic volume
Driver is running.
STORAGE\VOLUME\1&30A96598&0&SIGNATUREEA1AA9C7OFFSET7E00LENGTH1770CFC00
Name: Generic volume
Driver is running.
11 matching device(s) found on \\Server01.
= Copier
= Copier
Because all DevCon display operations also find hardware IDs, you can use any display
operation to search for hardware IDs. Select the operation based on the content that
you need in the output. For example, to find the device drivers that mouse-related
devices on a local computer use, submit the following command.
= Copier
= Copier
HID\VID_045E&PID_0039\6&DC36FDE&0&0000
Name: Microsoft USB IntelliMouse Optical
Driver installed from c:\windows\inf\msmouse.inf [HID_Mouse_Inst]. 2
file(s) used by d
river:
C:\WINDOWS\System32\DRIVERS\mouhid.sys
C:\WINDOWS\System32\DRIVERS\mouclass.sys
ROOT\RDP_MOU\0000
Name: Terminal Server Mouse Driver
Driver installed from c:\windows\inf\machine.inf [RDP_MOU]. 2 file(s)
used by driver:
C:\WINDOWS\System32\DRIVERS\termdd.sys
C:\WINDOWS\System32\DRIVERS\mouclass.sys
2 matching device(s) found.
The first command finds legacy drivers by a device instance ID pattern. The ID pattern is
prefaced by the at character (@) to indicate a device instance ID and followed by the
wildcard character (*) to find all devices in the ROOT\Legacy subkey.
= Copier
The second command finds legacy devices by searching for all devices in the
LegacyDriver class.
= Copier
Both commands produce the same output, in this case, finding the same 27 legacy
devices.
= Copier
= Copier
In response, DevCon lists the following seven devices in the Net setup class. The first six
are standard miniport driver devices. The seventh device, the RAS async adapter, is a
software-enumerated device (SW\*) that is not installed until it is needed.
= Copier
(PPPOE)
ROOT\MS_PPTPMINIPORT\0000 : WAN Miniport
(PPTP)
ROOT\MS_PTIMINIPORT\0000 : Direct
Parallel
SW\{EEAB7790-C514-11D1-B42B-00805FC1270E}\ASYNCMAC : RAS Async
Adapter
7 matching device(s) found.
The following command compares the DevCon Find and DevCon FindAll operations by
running a DevCon Find command with the same parameters as the previous DevCon
FindAll command.
= Copier
In response, DevCon lists the following six devices in the Net setup class.
= Copier
Predictably, the DevCon Find command, which returns only currently installed devices,
does not list the software-enumerated device because the device is not installed.
operators, DevCon displays the filter drivers for the class, but does not change them.
= Copier
In response, DevCon displays the upper filter drivers for the DiskDrive class and confirms
that it did not change them. In this case, the display shows that devices in the DiskDrive
setup class use the PartMgr.sys upper filter driver.
= Copier
This command uses the add-after (+) ClassFilter operator to load the Disklog driver after
the PartMgr driver so that it receives data that PartMgr.sys has already processed.
When the command starts, the virtual cursor is positioned before the first filter driver.
Because it is not positioned on a particular driver, DevCon adds the Disklog driver to the
end of the filter driver list.
The command also uses the /r parameter, which reboots the system if it is necessary to
make the class filter change effective.
= Copier
In response, DevCon displays the current upper filter drivers for the DiskDrive class.
= Copier
Class filters changed. Class devices must be restarted for changes to take
effect.
PartMgr
Disklog
If you misspell the driver name, or try to add a driver that isn't installed on the system,
the command fails. DevCon does not add a driver unless the driver is registered as a
service, that is, unless the driver has a subkey in the Services registry subkey
(HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services).
The following command tests this safeguard feature. It attempts to add "Disklgg"
(instead of "Disklog") to the list of upper filters for the DiskDrive class. The output
demonstrates that the command fails.
= Copier
= Copier
The following list shows the filter drivers for the DiskDrive class before the command is
submitted.
= Copier
PartMgr
Disklog
The first subcommand, @Disklog, uses the positioning operator (@) to place the virtual
cursor on the Disklog filter driver. The second subcommand, -MyFilter, uses the add-
before operator (-) to add MyFilter.sys before Disklog.sys.
The command also uses the /r parameter, which reboots the system if it is necessary to
The positioning operator is essential in this example. Before DevCon processes any
classfilter subcommands, the virtual cursor is at the beginning of the list and is not
positioned on any filter drivers. If you use the add-before (+) operator when the cursor
is not on positioned on a driver, DevCon adds the driver to the beginning of the list. If
you use the add-after (-) operator when the cursor is not positioned on a driver, it adds
the driver to the end of the list.
In response, DevCon displays the current upper filter drivers for the DiskDrive class.
= Copier
Class filters changed. Class devices must be restarted for changes to take
effect.
PartMgr
MyFilter
Disklog
You can also use the following command to add the MyFilter driver and to place it
between PartMgr and Disklog. In this example, the first subcommand, @PartMgr,
positions the virtual cursor on the PartMgr filter driver. The second subcommand,
+MyFilter, uses the add-after operator (+) to add MyFilter.sys after PartMgr.
= Copier
= Copier
The following list shows the filter drivers for the DiskDrive class before the command is
submitted.
= Copier
PartMgr
MyFilter
Disklog
The first subcommand uses the delete operator (!) to delete MyFilter from the list of
upper filter drivers for the DiskDrive class. (It does not affect the MyFilter.sys file in the
C:\Windows\System32\Drivers directory.)
The second subcommand uses the add-after operator (+) to place the new filter driver
in the position that the deleted driver occupied. Because the delete operator leaves the
cursor in the position that the deleted filter occupied, the add-before (-) and add-after
(+) operators have the same effect.)
The command also uses the /r parameter, which reboots the system if it is necessary to
make the class filter change effective.
In response, DevCon shows the new class filter configuration for the DiskDrive class.
= Copier
Class filters changed. Class devices must be restarted for changes to take
effect.
PartMgr
MyNewFilter
Disklog
= Copier
The following list shows the filter drivers for the DiskDrive class before the command is
submitted. It also shows the intended result of the command.
Before After
PartMgr PartMgr
MyNewFilter Disklog
Disklog MyNewFilter
The first subcommand uses the delete operator (!) to delete Disklog from the list. The
second subcommand uses the start operator (=) to move the virtual cursor back to the
starting position and then uses the positioning operator (@) to place the cursor on the
PartMgr driver. The start operator is necessary because the virtual cursor moves only
forward through the list. The final subcommand uses the add-after operator (+) to add
Disklog after PartMgr.
In response, DevCon shows the new class filter configuration for the DiskDrive class.
= Copier
Class filters changed. Class devices must be restarted for changes to take
effect.
PartMgr
Disklog
MyNewFilter
= Copier
In response, DevCon displays the device instance ID of the device and explains that you
must reboot the system to enable the device.
= Copier
ACPI\PNP0000\4&B4063F4&0 : Enabled on
reboot
Not all of 1 device(s) enabled, at least one requires reboot to complete the
operation.
You can respond by rebooting the system, either manually, or by using the DevCon
Reboot operation.
The following command adds the /r parameter to the previous command. The /r
parameter reboots the system only if rebooting is required to complete an operation.
= Copier
In response, DevCon enables the device and then reboots the system to make the
enabling effective.
When the system starts, use a DevCon status command to confirm that the device is
enabled.
= Copier
ACPI\PNP0000\4&B4063F4&0
Name: Programmable interrupt controller
Driver is running.
= Copier
In response, DevCon displays the device instance ID of the printer that it found in the
Printer class and reports that it is enabled. Although the command included the /r
parameter, the system did not reboot because a reboot was not required to enable the
printer.
= Copier
LPTENUM\HEWLETT-PACKARDDESKJET_1120C\1&7530F08&0&LPT1.4 : Enabled
1 device(s) enabled.
Note Before using an ID pattern to disable a device, determine which devices will be
affected. To do so, use the pattern in a display command, such as devcon status USB\*
or devcon hwids USB\*.
= Copier
In response, DevCon displays the device instance IDs of the USB devices and reports
that they are disabled. Although the command included the /r parameter, the system
did not reboot because a reboot was not required to disable the devices.
= Copier
USB\ROOT_HUB\4&2A40B465&0
: Disabled
USB\ROOT_HUB\4&7EFA360&0
: Disabled
USB\VID_045E&PID_0039\5&29F428A4&0&2
: Disabled
3 device(s) disabled.
Also, because the device instance IDs include the ampersand character (&), they are
enclosed in quotation marks. The command includes the /r parameter, which reboots
the system if it is necessary to make the disabling effective.
= Copier
In response, DevCon displays the device instance IDs of the USB devices and reports
that they are disabled. Although the command included the /r parameter, the system
did not reboot because a reboot was not required to disable the devices.
= Copier
USB\ROOT_HUB\4&2A40B465&0
: Disabled
USB\ROOT_HUB\4&7EFA360&0
: Disabled
USB\VID_045E&PID_0039\5&29F428A4&0&2
: Disabled
3 device(s) disabled.
You can use this command to replace signed drivers on the system with alternate drivers
for testing or troubleshooting, or to associate the devices with the newest version of the
same drivers.
= Copier
In response, DevCon displays a Hardware Installation warning explaining that the driver
has not passed Windows Logo testing. If you select the Continue Anyway button on the
dialog box, the installation continues.
= Copier
You can also use the DevCon UpdateNI operation, the noninteractive version of the
DevCon Update operation, to update drivers. The DevCon UpdateNI operation is
identical to the DevCon Update operation except that it suppresses all user prompts
that require a response and assumes the default response to the prompt.
The following command uses the DevCon UpdateNI operation to install the test driver.
= Copier
In this case, DevCon does not display the Hardware Installation warning. Instead, it
assumes the default response, Stop Installation. As a result, DevCon cannot update the
drivers and displays a failure message.
= Copier
on the local computer. The command includes the full path to the INF file for the device
(keyboard.inf) and a hardware ID (*PNP030b).
= Copier
In response, DevCon reports that it has installed the device, that is, it has created a
device node for the new device and updated the driver files for the device.
= Copier
Device node created. Install is complete when drivers files are updated...
Updating drivers for *PNPO30b from c:\windows\inf\keyboard.inf
Drivers updated successfully.
To install this device during an unattended setup, begin by adding the following files to
a floppy disk: devcon.exe and netloop.inf (C:\Windows\inf\netloop.inf).
Then, to the [GUIRunOnce] section of the unattended setup file, add the following
DevCon command:
= Copier
This command identifies the loopback adapter by using its hardware ID, *MSLOOP. The
single quote character preceding "*MSLOOP" tells DevCon to interpret the string
literally, that is, to interpret the asterisk as part of the hardware ID, not as a wildcard
character.
The command also specifies that DevCon use the Netloop.inf file (on the floppy disk) in
the installation. The /r parameter reboots the computer only if a reboot is necessary to
complete the installation.
Finally, add network configuration settings to the unattended setup file and run the
unattended setup.
Warning Before removing any devices by using a pattern, determine which devices are
affected. To do so, use the pattern in a display command, such as devcon status @usb\*
or devcon hwids @usb\* .
= Copier
In response, DevCon displays the device instance ID of the devices that it removed.
= Copier
USB\ROOT_HUB\4&2A40B465&0 : Removed
USB\ROOT_HUB\4&7EFA360&0 : Removed
USB\VID_045E&PID_0039\5&29F428A4&0&2 : Removed
3 device(s) removed.
Warning Before removing any devices by using a pattern, determine which devices will
be affected. To do so, use the pattern in a display command, such as devcon status
=net *ndiswan or devcon hwids =net *ndiswan* .
= Copier
In response, DevCon displays the device instance ID of the device that it removed.
= Copier
= Copier
devcon rescan
In response, DevCon reports that it scanned the system but found no new devices.
= Copier
You can also use a DevCon Rescan command on a remote computer. The following
command runs the DevCon Rescan operation on Server01, a remote computer, by
adding the /m parameter to the command.
= Copier
= Copier
In response, DevCon displays the device instance ID of the device and reports the result.
= Copier
ROOT\*MSLOOP\0000 : Restarted
1 device(s) restarted.
You can include this command in scripts and batch files that require the system to
reboot.
= Copier
devcon reboot
DevCon uses the standard ExitWindowsEx function to reboot. If the user has open files
on the computer or a program will not close, the system does not reboot until the user
has responded to system prompts to close the files or end the process.
The command does not use any symbol parameters to position the ID. By default,
DevCon adds new hardware IDs to the end of a hardware ID list. In this case, because
the device has no other hardware IDs, placement is irrelevant.
= Copier
= Copier
ROOT\LEGACY_BEEP\0000 : beep
Modified 1 hardware ID(s).
The command uses the - symbol parameter to add the new hardware ID to the end of
the hardware ID list for the device, in case a preferred hardware ID has been created for
one of the devices. It uses the /m parameter to specify the remote computer. It also
uses a device instance ID pattern, @ROOT\LEGACY\* , to identify the legacy devices on the
computer, that is, all devices whose device instance ID begins with ROOT\LEGACY* .
= Copier
In response, DevCon displays the resulting hardware ID lists for all affected devices.
= Copier
ROOT\LEGACY_AFD\0000 : legacy
ROOT\LEGACY_BEEP\0000 : beep,legacy
ROOT\LEGACY_CRCDISK\0000 : legacy
ROOT\LEGACY_DMBOOT\0000 : legacy
ROOT\LEGACY_DMLOAD\0000 : legacy
ROOT\LEGACY_FIPS\0000 : legacy
...
ROOT\LEGACY_WANARP\0000 : legacy
Modified 27 hardware ID(s).
After you assign the same hardware ID to a group of devices, you can use the other
DevCon operations to view and change the devices in a single command.
For example, the following command displays the status of all legacy devices.
= Copier
The command uses the /m parameter to specify the remote computer. It uses the
hardware ID, legacy, to identify all devices that have that hardware ID. Then, it uses the !
symbol parameter to delete the legacy hardware ID.
= Copier
In response, DevCon displays the resulting hardware ID lists for all affected devices.
= Copier
ROOT\LEGACY_AFD\0000 :
ROOT\LEGACY_BEEP\0000 : beep
ROOT\LEGACY_CRCDISK\0000 :
ROOT\LEGACY_DMBOOT\0000 :
ROOT\LEGACY_DMLOAD\0000 :
ROOT\LEGACY_FIPS\0000 :
...
ROOT\LEGACY_WANARP\0000 :
Modified 27 hardware ID(s).
This series uses a fictitious device, DeviceX, with the device instance ID, ROOT\DeviceX
\0000. Before using DevCon, the device had the following list of hardware IDs:
= Copier
Hw3 Hw4
The following command uses the + symbol to add Hw1 and Hw2 to the beginning of a
list of hardware IDs for DeviceX. Because Hw2 already appears in the list, it is moved,
not added. The command identifies the device by its device instance ID, as indicated by
the at character (@) preceding the ID.
= Copier
In response, DevCon displays the new hardware ID list for the device. Note that Hw1 and
Hw2 appear at the beginning of the list in the specified order.
= Copier
ROOT\DEVICEX\0000 : Hw1,Hw2,Hw3,Hw4
Modified 1 hardware ID(s).
Also, DevCon reports that it modified one hardware ID list, that is, the hardware ID list of
one device.
The following command uses the ! symbol to delete the Hw1 hardware ID. It then lists
the hardware ID, Hw5, without a symbol parameter. Without symbol parameters,
SetHwID adds the hardware ID to the end of the hardware ID list for the device.
This command demonstrates that, unlike the other symbol parameters for the DevCon
SetHwID operation, the ! symbol applies only to the hardware ID that it prefixes.
= Copier
= Copier
ROOT\DEVICEX\0000 : Hw2,Hw3,Hw4,Hw5
Modified 1 hardware ID(s).
The following command uses the = parameter to replace all hardware IDs in the list for
DeviceX with a single hardware ID, DevX.
= Copier
= Copier
ROOT\DEVICEX\0000 : DevX
Modified 1 hardware ID(s).
The success message indicates that DevCon modified the hardware ID of one device.
The first command uses the DevCon SetHwID operation to change the hardware ID of
the HAL from acpiapic_up, the hardware ID for uniprocessor HALs, to acpiapic_mp, the
hardware ID for multiprocessor HALs.
You must change the hardware ID because the INF file for the HAL includes drivers for
both uniprocessor and multiprocessor HALs. The system selects the most appropriate
driver from the INF file based on the hardware ID of the device. If you do not change the
hardware ID, then the DevCon Update command would simply reinstall the
uniprocessor HAL driver.
In the following command, the command identifies the HAL by its instance ID,
ROOT\ACPI_HAL\0000, as indicated by the @ character preceding the ID. The command
uses the + character to make acpiapic_mp the first hardware ID in the list for the HAL.
Then, it uses the ! character to delete the acpiapic_up hardware ID from the list of IDs
for the HAL.
= Copier
In response, DevCon displays the following new hardware ID list for the HAL.
= Copier
ROOT\ACPI_HAL\0000 : acpiapic_mp
Modified 1 hardware ID(s).
The following command uses the DevCon Update operation to update the driver for the
HAL.
= Copier
= Copier