Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

safely remove hardware (usb flash drives)

Posted on 2010-11-11
4
Medium Priority
?
1,360 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 2000 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 3

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 3

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
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…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

916 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