Solved

safely remove hardware (usb flash drives)

Posted on 2010-11-11
4
1,353 Views
Last Modified: 2012-06-27
Is there a MS (or 3rd party) api that would allow me to "safely remove hardware" (usb flash drives) in a Delphi app?  I'd like to be able to remove 4 to 10 drives at a time. (Then install a new batch of drives . . . etc.).

If not possible, is there a way to force cache to be written to the flash drive(s) in a manner that when a drive is later used, W7 won't insist on "fixing it".

Thanks - Ed
0
Comment
Question by:Ed Covney
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
rogerard earned 500 total points
ID: 34114400
Here is a site that has code to do what you want, with links to some addons that help for the times when the drives are being stubborn and not ejecting.
http://www.pocketappreview.com/main/item/17
0
 
LVL 2

Author Comment

by:Ed Covney
ID: 34117288
I suspect it might work. Examples are hard to come byt though and I have posted a question.
But it still doesn't answer the question, how does W7 know a drive needs "fixing"?
0
 
LVL 7

Expert Comment

by:rogerard
ID: 34120169
I don't know the answer to the answer of how windows (not just w7) knows that a drive needs fixing except that it does.  I know that it occurs mostly on drives that were formatted using NTFS (FAT32 is more suited for quick eject).  If you download the addon utilities linked from the EjectUSB page (Unlocker, Handle.exe, DevEject, Removedrive, and Sync), you will rarely have a drive a drive that doesn't eject within a few seconds.  I think the addon sync is the key to the cache problem for you.
0
 
LVL 2

Author Closing Comment

by:Ed Covney
ID: 34124594
rogerard:

EjectUSB works great if I limit its work load. I now have 15 batch files (F-Eject.bat .. thru  T-Eject.bat) that I execute per drive as I finish with the one drive. While F-drive is ejecting, I'm formatting and filing G-drive, etc, etc.  EjectUSB is an excellent and very useful tool. Thanks very much for finding it for me.

-Ed

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question