Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a USB device that I am controlling via a WCF service I created. That works fine, except the USB device gets hung-up in a weird state and needs to be power cycled on occasion.

Ultimately I would like a .NET solution or even a remote PowerShell script that I can execute to disable power to the device (which is powered over USB). But I haven't found a way to disable power to a USB port.

Is there any way to do this, even if it requires using Remote Desktop to log into the computer and do it? The computer is running Windows 10 and the user has full administrator privileges.

What I have tried:

I have tried disabling the device and uninstalling the device from Device Manager, however the device stays powered on yet.
Posted
Updated 16-Sep-19 20:07pm
Comments
RedDk 16-Sep-19 18:22pm    
This is just a shot in the dark but isn't USBDeview capable of turning off the power of any "powered" device it enumerates during a scan? S'great little app when sleuthing USB connectivity and determining hardware configurations ... google it. It's like savoir faire, man.
MrGlass3 16-Sep-19 18:30pm    
I tried using that, but I didn't see any option to actually kill the power to the device. I can disable it but it still gets power. Am I missing something?
RedDk 17-Sep-19 14:28pm    
Well that actual solution to "kill" the device might be, then, to install a hardware switch ... THIS is the solution to many mods that come to MY mind when thinking of adding holes to the steel case to do something to the innards ... but the device would have to have a connection to the motherboard's power that was accessible through the power unit alone. Obviously if it's on a PCIe/PCI/AGP/other card then there might be derivative power leached off an edge connection (which you don't know about). Disabling BIOS objects (sp) doesn't necessarily power-off them.

Get a separate power supply that you can remotely "cycle" if it's that important.

One "example".

3Gstore Remote Power IP Switch - 2 Outlets: Amazon.ca: Electronics[^]
 
Share this answer
 
Comments
MrGlass3 16-Sep-19 16:09pm    
Thank you. And I should have specified that I am completely open to a hardware solution. I was hoping for something a little simpler that was basically just a USB passthrough device that could remotely sever the connection, I tried looking for that but couldn't find such a thing.
RedDk 17-Sep-19 14:39pm    
Hhmm,

I'm curious ... you say cycle and I'm wondering what would happen, given the ability to mix up the power scheme having another source tentacled as such to the same motherboard, and as I say in my latest comment above, on a card that has edge power "somehow", what that bonafide card power would say about a real cycle disparity. Would there be a synchronization? Would no synch even be a problem (like a modem out of synch with a computer that's not on the same wall outlet)?

This sounds like a good idea.
MrGlass3 17-Sep-19 19:08pm    
I was beginning to think something along that same line of thought. I was thinking maybe cutting the USB cord and running the power conductor through a relay switch that I could remotely turn off?
It seems this library can control USB power: GitHub - libusb/libusb: A cross-platform library to access USB devices[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900