I want to write a program to work with my usb port(windows).I don't know how to say this but this is how it should work.The program should run(that's should be the first thing [before virus guard ask whether this flash drive should scan]) when a flash drive or a external hard drive plugin to a usb port. I'm not talking about auto run.How can I do that.
Asked
Active
Viewed 146 times
0
-
1Possible duplicate of: [Detect USB Drive in Java](http://stackoverflow.com/questions/3831825/detect-usb-drive-in-java) – Adel Khial Jul 28 '16 at 17:09
1 Answers
1
You need to use Library called WinUSB on windows
https://msdn.microsoft.com/en-us/library/windows/hardware/dn303342(v=vs.85).aspx
for MAC OSX(MAC OS) https://developer.apple.com/library/mac/documentation/DeviceDrivers/Conceptual/USBBook/USBIntro/USBIntro.html
for Linux Note also cross platform http://libusb.info/

NinjaDeveloper
- 1,620
- 3
- 19
- 51
-
libusb is also available for macOS and Windows, fwiw. It's kind of awkward to use in Windows, though. – Jul 28 '16 at 17:45