Windows: disable / enable USB hub WITHOUT reboot

I would like to be able to programmatically disable or enable a USB hub to connect USB devices that are inaccessible or accessible to it, respectively. I did some testing using the device manager, and then using Devcon, and found that when certain devices are connected to the hub (in particular, to some Android phones), it cannot be immediately disconnected, and it is marked to disconnect after rebooting. I tried to overcome this problem by trying to also disconnect the problem devices connected to the hub, but this also failed. I also tried using the SetupDixxx API directly and even some USB IOCTLs, but I was not able to complete this task. I believe that there should be a way to force the immediate disconnection of the hub without rebooting. I would appreciate it if someone could point me on the right path.

Thanks in advance, Ziv

+4
source share
1 answer

this script is for this (requires Microsoft DEVCON for now

https://www.robvanderwoude.com/sourcecode.php?src=resetdevices_w7

In addition, there is a tool called "Blackusb" that also does what you want

https://github.com/maravento/dxt#blackusb

0
source

All Articles