Disables devices on the computer. Valid only on the local computer.
To disable a device means that the device remains physically connected to the computer, but its driver is unloaded from memory and its resources are freed so that the device cannot be used.
devcon [/r] disable {* | ID [ID ...] | =class [ID [ID ...]]}
The following special characters modify the ID parameter.
| Character | Description |
|---|---|
| * | 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. |
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.
DevCon reports a failure if it cannot find or cannot disable a device. It reports a success even if the device is already disabled. Before and after disabling a device, use the DevCon Status operation to verify the device status.
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*.
Because you might need to reboot the system to make the command effective, add the conditional reboot parameter (/r) to the command.
devcon disable * (not recommended) devcon /r disable *DVD-ROM* devcon /r disable =printer