To eject a USB device I do:
which sometimes give me the following error message:
This device is currently in use. Close any programs or windows that might be using the device, and then try again.
I am looking for a program on Windows to show which programs that is a given USB device in order to solve this issue.
Preferably the program should be able to kill all programs that is using files on the USB device, and tell whether the programs are actually using them (i.e. presence of I/O activity).