2

Possible Duplicate:
How to programatically unplug & replug an arbitrary USB device?

I have a USB device that sometimes 'gets lost' (just doesn't work anymore, probably because the driver or the product itself is not so good). however, an application I write relies on this device. what i need to do to get the device working again is plugging it out and in again.

I want to know whether i can do that somehow automatically from my C# application? like disabling and reenabling the usb port?

Community
  • 1
  • 1
Mat
  • 4,281
  • 9
  • 44
  • 66

1 Answers1

0

From what I understand, under windows, you might not be able to physically simulate the device remove and plug in back, but you can try disable the device and then enable it.

take a look at the SetupApi.dll

regarding how to do that in C# you can take a look at the following link

Win32 API function to programatically enable/disable device

Community
  • 1
  • 1
Johnny
  • 363
  • 1
  • 8