Our application involves an external device that mounts as a USB mass storage device. I need to be able to check the integrity of that USB mass storage device from a Java application, running on Windows.

Currently I execute "chkdsk", which works fine unless the user's computer isn't configured for English. (Because I need to examine the chkdsk output to determine the state of the drive.) And, surprise, surprise, not every computer in the world is configured for English!

There is a Win32 class called "Win32\_Volume" with a method called "Chkdsk" that is just what I'm looking for.

I need to call it from Java, and JNA seems the way to go.

How can I use COM to call a method from a Win32 WMI class?