samuelcampos / usbdrivedetector

A Java library to get a list of all usb storage devices connected to the computer.
MIT License
128 stars 46 forks source link

Windows 10 is not supported #13

Closed Dgotlieb closed 6 years ago

Dgotlieb commented 7 years ago

Hi,

When I'm trying to do it on windows 10 I'm getting:

"no instances available" when trying it from CMD.

Any idea?

SnowyCoder commented 6 years ago

It seems that the command changed from win7 "wmic" to win8+ "c:\Windows\System32\wbem\wmic" (because it was removed from the path). It seems like the constant string that indicates the command is inlined and can't be changed with reflection

SnowyCoder commented 6 years ago

Can't write a pull request right now, if anyone wants a quick and dirty fix I wrote one here: https://pastebin.com/0budhvKJ It should work 90% of the time