tags:

views:

2437

answers:

2

How can I detect and remove a USB flash disk programatically using delphi?

I have seen some of the examples in this website, but they lack clear explanation on how to go about it!

Please examples will really help!

+1  A: 
mghie
It would be quite bad if a non-user admin could remove a USB disk that's in use by an admin (or even determine whether it's in use). So the limitation seems logical.
MSalters
Not really. This code does not work for me (non-admin, member of "Power Users") even though I can remove the USB stick via the "Safely Remove Hardware" icon in the notification area. It works with "Run As..." and the Administrator account, though...
mghie
A: 

Provided code does not work under WindowsXP SP3 + user without administrator privileges.

Zazhigatel
Right, and I said as much in my answer.
mghie