I am not familiar with USB and I am not able (with delphi) to improve my software with a self disconnect USB function.
The program is on and runs from a USB memory drive (e. g. F:/) and when it stop what I try to do is to auto eject the device.
I also tried to do a .bat file that runs a program that disable the USB device. If this .bat file is launched from local drive (C:/) everything is ok, but if this .bat file is launched from USB stick (F:/) it fails.
Here the link where I got the information:
How can i remove a USB flash disk programmatically using delphi?
Any suggestion in delphi?