Avatar of ThomasReimann
ThomasReimann
 asked on

Disabling a device with Devcon.exe

I need to disable a USB device in command line on Windows 7 Ultimate x64.

I've downloaded devcon.exe from here:

http://support.microsoft.com/kb/311272

When I start the 64bit executable I get this:

This version of C:\Work\devcon.exe is not compatible with the version of Windows
 you're running. Check your computer's system information to see whether you nee
d a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the so
ftware publisher.

When I start the 32 bit executable it works.

devcon Usage: devcon [-r] [-m:\\<machine>] <command> [<arg>...]
For more information type: devcon help

I've tried some commands like devcon classes and it seems to work.

Now I want to disable a USB device.

the Hardware id is USB\VID_0BC7

But devcon disable *USB\VID_0BC7* gives:

C:\Work>devcon disable *USB\VID_0BC7*
USB\VID_0BC7&PID_0006\5&2093BC86&0&2                        : Disable failed
No devices disabled.

UAC is off.

Disabling/Enabling this device in device manager works.

I need to get the disable working. An alternate way (without devcon) to disable a USB device by command line will also be accepted.
System UtilitiesWindows 7Windows Batch

Avatar of undefined
Last Comment
ThomasReimann

8/22/2022 - Mon
Bill Bach

I've not used DEVCON before, but an obvious solution comes to light -- when you spawn the CMD window, right-click it and select "Run as Administrator", which should provide elevated privileges.  Many command-line applications won't spawn a UAC window -- they will just fail.

I think the fact that the x64 version wouldn't run might be a clue here, too.  What if you run the x64 version from the Start/Run command line, instead of from a Command Prompt?
ThomasReimann

ASKER
I've had of course an Administrator Command Line (the title of the cmd shows Administrator:). If you disable UAC you get always the admin cmd window.

Running the 64bit exe from Start/Run gives the same message, but as a dialog window. I guess the 64bit version has a hardcheck for WindowsXP x64 (devcon.exe is from 2003).

ASKER CERTIFIED SOLUTION
eerok512

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ThomasReimann

ASKER
Downloaded and mounted the iso. There is no WinDDK folder. Searched also for devcon.exe, no results.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ThomasReimann

ASKER
Found it after installing setuptools_x64fre.msi.