DevCon SetHwID

Adds, deletes, and changes the order of hardware IDs of root-enumerated devices on a local or remote computer.


    devcon [/m:\\computer] sethwid {* | ID [ID ...] | =class [ID [ID ...]]} := [ = | + | - | ! ]HardwareIDs ...

   

Parameters

/m:\\computer

Runs the command on the specified remote computer. The backslashes are required.

Note   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 WDK 8.1 and WDK 8, the remote access is unavailable.
*

Represents all devices on the computer.

ID

Specifies all or part of a hardware ID, compatible ID, or device instance ID of a device. When specifying multiple IDs, type a space between each ID. IDs that include an ampersand character (&) must be enclosed in quotation marks.

The following special characters modify the ID parameter.

CharacterDescription

*

Matches any character or no character. Use the wildcard character (*) to create an ID pattern, for example, *disk*.

@

Indicates a device instance ID, for example, @ROOT\FTDISK\0000.

'

(single quote)

Matches the string literally (exactly as it appears). Precede a string with a single quote to indicate that an asterisk is part of the ID name and is not a wildcard character, for example, '*PNP0600, where *PNP0600 (including the asterisk) is the hardware ID.

 

=class

Specifies the device setup class of the root-enumerated devices. The equal sign (=) identifies the string as a class name.

You can also specify hardware IDs, compatible IDs, device instance IDs, or ID patterns following the class name. Type a space between each ID or pattern. DevCon finds devices in the class that match the specified IDs.

HardwareIDs

Specifies one or more hardware IDs.

If the hardware IDs are not preceded by a symbol parameter (+, -, =, !), DevCon adds or moves the specified hardware IDs to the end of the list of hardware IDs for the device in the specified order. This is equivalent to the - parameter.

=

Replaces the list of hardware IDs for the device with the specified hardware IDs in the specified order.

+

Adds or moves the specified hardware IDs to the beginning of the list of hardware IDs for the device.

-

Adds or moves the specified hardware IDs to the end of the list of hardware IDs for the device.

!

Deletes the specified hardware IDs from the list of hardware IDs for the device.

Comments

A root-enumerated device is a device that appears in the ROOT registry subkey (HKEY_LOCAL_MACHINE\System\ControlSet\Enum\ROOT).

You can specify multiple hardware IDs in each command. The ! (delete) parameter applies only to the hardware ID that it prefixes. The other symbol parameters apply to all hardware IDs that follow until the next symbol parameter in the command.

DevCon moves, rather than adds, a hardware ID if the specified hardware ID already exists in the list of hardware IDs for the device.

The success message for a DevCon SetHwIDs command reports the number of devices (or device lists) in which it has modified hardware IDs, not the number of modified hardware IDs .

Sample Usage


devcon sethwid @ROOT\LEGACY* := legacy
devcon sethwid @ROOT\LEGACY_AFD\0000 := =afd1 afd2 afd3
devcon sethwid legacy := devtype3 -devtype4
devcon sethwid legacy afd1 := +devtype3
devcon sethwid @ROOT\LEGACY_BEEP\0000 := !beep legacy

Examples

Example 40: Assign a hardware ID to a legacy device

Example 41: Add a hardware ID to all legacy devices on a remote computer

Example 42: Delete a hardware ID from all legacy devices on a remote computer

Example 43: Add, delete, and replace hardware IDs

Example 44: Forcibly update the HAL

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft