Devcon Failed Windows 10

Active1 year, 6 months ago
WindowsDevcon disable failed windows 10

And ever since I got windows 10 pro 64 bit which has been upgraded from windows 7 accordingly, The PC restarts right after it finishes the script (kind of a requirement by the system in order to disable the device), back in win 7, I could turn it on and off as many times I like without the need to reboot.

I'm automating the removal of a USB printer from machines with Windows XP SP3.To do this, I'm using Microsoft's Devcon Utility.

Running the command:

Returns:

Running the command:

Returns:

Windows 10 free upgrade

I've tried multiple combinations of the Hardware ID and wildcards with no luck.Plugging the device in to the computer and running the remove command mentioned above removes the hardware.

The issue comes from me using devcon piped to find to determine if the device is plugged in so that it can be automatically configured. If I can't remove it, it will be detected by my script even if it isn't plugged in.

I've tested this with multiple USB printers and one USB mouse, all exhibit the same behavior, which leads me to believe this is normal behavior for Devcon.

Is there a workaround? How do I remove hardware entries that are no longer connected?

Kalamane
KalamaneKalamane
1661 gold badge3 silver badges14 bronze badges

3 Answers

Devcon does work. You just need to make sure you are targeting the right version of devcon for your operation system.

Take a look at this link http://freneticrapport.blogspot.com/2011/05/windows-hiddennot-connected-device.html.

For installing the correct devcon version for your OS:

  • Install the Windows Driver Kit
  • Go to Start -> Programs -> Development Kits -> WDK XXXX -> Build Environments -> Windows [Target] -> Windows [Target] Free Build Environment, replacing [Target] with the appropriate version of Windows you are building for.
  • Go to the srcsetupdevcon folder in the WDK install directory and run:build -ceZ

You can then remove the device with the following command:

Take note of the quotes and @ symbol as these are required to allow hidden devices to be removed.

GregL
7,1422 gold badges21 silver badges29 bronze badges
NitrousNitrous

devon can and will remove non present hardware as GregL mentioned.

The string must be formated correctly.

The following batch file will match all devices based on the input string and remove them:

roscoe_casitaroscoe_casita

Devcon cannot remove hardware that isn't currently connected.This is intended behavior. I should have read the documentation better.

The findall command searches for ALL hardware, connected or not.I should have been using the find command, which only searches for currently connected hardware.

KalamaneKalamane

Devcon Failed Windows 10 Loop

1661 gold badge3 silver badges14 bronze badges

Devcon Disable Failed

Not the answer you're looking for? Browse other questions tagged automationautomated-install or ask your own question.