EjectUSB

EjectUSB
Version 1.6
Designed to be a simple utility to close all programs running from a specified drive or folder and then attempt ejection if a drive was specified. Extended functionality includes flushing the file cache, closing Explorer windows and removing registry entries and Recent Document shortcuts referencing the specified drive or folder.

Documentation and an example configuration file are included in the ZIP. The source code is available as a separate download.

TrueCrypt and combination flash card / flash drives support will be made available via configuration files after sufficient testing has been conducted.

See EjectUSB in action!
» Watch the flash video

Release Version 1.6:
» Download EjectUSB (259 kilobytes, 135103 downloads)
» Source Code (26 kilobytes, 11813 downloads)


Change Log:
Version 1.6
- Bug fix: EjectUSB no longer triggers file access errors on WinXP when run from read-only media when trying to load its hourglass tray icon.
- Bug fix: Sysinternals registry keys are no longer erroneously deleted.

Version 1.5 (161498 downloads)
- Bug fix: EjectUSB's ejection success message will more reliably appear on Vista.
- Bug fix: EjectUSB's ejection success message will only disappear when the ejected drive is unplugged instead of disappearing when any USB device is unplugged.
- Bug fix: EjectUSB will no longer display an error if WMI functions fail.
- Improvement: EjectUSB's ejection success message now displays the ejected drive's name.
- Addition: Added /ini command line argument to allow a settings file to be specified.
- Addition: Added /settings command line argument to display a settings interface window.
- Addition: Included Settings.bat with the download to make adjusting settings easier.
- Change: Modified the manifest information.

Version 1.4 (88989 downloads)
- Bug fix: Graceful program closing no longer only targets programs with a visible window.
- Bug fix: Flushing file buffers can no longer cause ejection to fail.
- Improvement: Dead tray icon cleanup is more resilient and slightly faster.
- Improvement: EjectUSB can now generate its own ejection success message. This will make ejection seem much faster on most computers.
- Addition: Added NoFakedMsg setting to the configuration file format.

Version 1.3 (107575 downloads)
- Bug fix: Program closing on Win9x works again (was broken in 1.2).
- Bug fix: Fixed issues on Win9x when running EjectUSB from a drive's root folder.
- Improvement: Implemented hybrid batch scripting. This provides theorhetical support for TrueCrypt and combination flash card / flash drives as well as conditional operations.
- Improvement: EjectUSB can now interface with EjectMedia.exe to eject flash cards / CDs.
- Improvement: Implemented support for Subst.
- Addition: Added DoNotSubst and NoRedirect settings to the configuration file format.
- Addition: Added /nobat command line argument to disable use of the hybrid batch file (if present). Meant to be used within the hybrid batch file if starting another instance of EjectUSB to prevent infinite loops.

Version 1.2 (4933 downloads)
- Bug fix: Improved handling of relative paths (\ and ..).
- Improvement: Implemented API-based ejection.
- Improvement: Implemented file cache flushing. Requires admin privileges.
- Improvement: EjectUSB can now interface with Sync (from Sysinternals) to flush the file cache (instead of using its own internal file cache flushing function). Requires admin privileges.
- Improvement: Improved command line argument parsing; drive letter or folder path no longer are required at all and no longer must be the first command line argument.
- Improvement: Efficiency improvements related to DLL calls.
- Addition: Added DoNotFlush and NoEjectAPI settings to the configuration file format.
- Change: RemoveDrive.exe is called with the -L switch to loop until successful ejection. This can be aborted by closing the RemoveDrive.exe console window.
- Change: DevEject.exe is now launched hidden.
- Change: Added current version number to EjectUSB.exe version info.

Version 1.1 (3413 downloads)
- Bug fix: Improved ejection capability via EjectUSB's own internal ejection routine.
- Bug fix: Improved command line argument and input parsing for handle.exe; there were some formatting differences between the output on Win9x and WinXP.
- Bug fix: TimeToWait is now a maximum per ''phase'' rather than per program; in rare cases EjectUSB could wait for multiple minutes on closing programs with the default TimeToWait value of 5 (seconds).
- Bug fix: Cleaning up dead tray icons was triggered by faulty criteria; in simple terms, dead tray icon cleanup was occuring when it didn't need to (wasting up to 1 second).
- Improvement: Minor efficiency improvements related to the previous two changes.
- Improvement: EjectUSB can now interface with Unlocker to close open file handles; simply UniExtract the Unlocker installer and put Unlocker.exe and UnlockerDriver5.sys in the same folder as EjectUSB. Unlocker requires admin privileges and doesn't work on Win9x.
- Improvement: Added a FAQ section to the documentation.
- Change: Slight change to the EjectUSB logo.
- Change: Separated the source code into its own ZIP file. Source code for EjectUSB will always be released with each version of EjectUSB.

Version 1.0 (1695 downloads)
- Initial release.

[ 07 August, 2009 ] • [ William Hedrick ] • [Bookmark and Share]

Comments (151)

[ Page 8 of 8 ] • [ << | < | 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 | > | >> ]

MUY bUENO EL Programa
[ 25 February, 2010 ] • [ Jesús Escalona ] • [ 14:07:36 ]

Muito obrigado pelo excelente e util programa.
[ 03 April, 2010 ] • [ Depeo da Masol ] • [ 20:29:08 ]

Great tool! Love it.
Do you have any ideas for a tool that will clean up the Removable Media? I've been using your tool for a while now, but lately it seems that my home computer just won't eject the USB drive anymore. It's frustrating. I'd like to be able to clean out all settings for a particular drive (or all drives) and start over. I've done some work on this but feel like I'm spinning my wheels. Contact me if you have some ideas via my website or here. Thanks!
[ 30 April, 2010 ] • [ itlan ] • [ 18:45:49 ]

I'm really not sure what you mean by ''clean up'' the removable media; regardless, the only real settings I can think of for USB devices can be managed with USBDeview by Nir Sofer:
http://www.nirsoft.net/util...
But even if you remove the entry for a given USB device from there, I don't think it'll have any impact on whether it can be ejected.

My best guess is you have some program running on your computer that's opening file handles to the drive and preventing Windows from letting it eject. Try using Unlocker on the drive and see what files it says are in use (when ejection fails):
http://ccollomb.free.fr/unl...
[ 30 April, 2010 ] • [ William Hedrick ] • [ 19:07:41 ]

I use safelyremove.com which has an unlocker. But in reality I can plug in the USB, then try to eject and still won't work. I think my computer is messed up because I can insert another USB and it will eject just fine. Thanks for the reply! I'll give that first program a try and let you know.
[ 01 May, 2010 ] • [ Itlan ] • [ 14:24:24 ]

I would love to have a program that simply reported all programs or file handles to a given disk. I don't mind closing things myself, but I hate the "sorry, can't eject, something is using the disk" message when I think I have closed everything. I would love to know exactly which program Windows identifies as using the disk. In other words, I think this is your program minus the actual closing the programs.
[ 03 May, 2010 ] • [ Kevin Black ] • [ 09:59:37 ]

Well, there already exist quite a few utilities that explicitly report which programs are using a given removable drive (or any files on any drive). The two which EjectUSB can use are called Handle and Unlocker, both of which are linked up above in the change log notes for version 1.1. Handle will only report which files are in use (and by what) while Unlocker also lets you unlock the files.
[ 03 May, 2010 ] • [ William Hedrick ] • [ 22:03:13 ]

USBDeview works great, combined with my manual registry hacks at least my USB drive shows up as a drive letter now. Still can't eject it as I can with other USB drives, as well as the same drive on a different computer. Thanks for the suggestion!
[ 04 May, 2010 ] • [ Itlan ] • [ 14:32:00 ]

I installed EjectUSB last week for turning off my Lacie External Hard Drive at night and when I'm not using it, to save electricity, and it puts out a lot of heat as well. For the last week it has worked fantastic, every time I click on it, a window appears in my Windows 7 64-bit Ultimate taskbar saying something to the effect, "ok to remove USB drive" (I already forgot the exact text as it appears word for word, sorry).

Last night EjectUSB stopped giving me the popup message, and the arrow icon for EjectUSB appeared in the taskbar and wouldn't leave for a very long time, when I right clicked on it, there was the option to "exit." I don't use my external hard drive to run programs on a regular basis. I mainly use it to store files, backups, and archives of executable installation files. Sometimes I use it to launch install setups of new applications, like the setup file for the latest version of CCleaner, and I archive the installation .executables of my favorite apps. (I still don't know how to delete and shred files on my external hard drive, I want to know of a free application(s), or several, that can delete, shred [overwrite several times like CyberShredder http://www.cylog.org/utilit... , or CCleaner so they cannot be recovered] and defragment the external USB drive so that it works more efficiently.) I don't think there should be any running applications using any resources on my external USB drive, but I still want the assurance of seeing the popup message telling me it's ok to remove the USB drive. I wonder what could have stopped the message from appearing so suddenly?

Norton told me it removed a virus last night. It wouldn't tell me the name of the Trojan or any clues to help me investigate how I contracted it, I don't like that about Norton, but it's free from Comcast, and I'm on a limited disability income. The old Mc Afee I could sort of piece together what I did and how I got the infection based on where it was found, and how it came in/or I let it in. Doesn't mean it has anything to do with this. Sorry such a long comment, thank you for a great application.
[ 04 May, 2010 ] • [ Alan P ] • [ 17:15:52 ]

Just adds a system tray icon with a spinning icon and that's all. No ejecting of usb drives, no UI, and when using the CLI again nothing happens.

Waste of time.
[ 19 May, 2010 ] • [ jones ] • [ 10:32:32 ]

Hi there!

How could we manage for having our app reviewed by Pocket App Review?

App's description:
Finally available, XFMobile is the Xfire gamers messenger application for mobile.
You can download this app on your iPhone, iPad or iPod touch : anyway XFMobile is free! The application runs straightforward even as being the result of independent developers' work. The chat system is really close to the Xfire environment, sends/receives messages really quickly. The user interface is correct and is being improved. With XFMobile you can change your username and Xfire status, as well as your Xfire contact list. You may like to know what games your friends are playing, if they are on or offline. Moreover, XFMobile allows you to take high quality in-game screenshots.
You can sign in for your Xfire login.

Looking forward to hearing from you,

Rivka
rivka@gamepe.com
[ 23 May, 2010 ] • [ Rivka ] • [ 10:39:27 ]

[ Page 8 of 8 ] • [ << | < | 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 | > | >> ]

Add Comment