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

Perfect tool for my pen drive ;)

Thanks
[ 14 June, 2008 ] • [ Dangu ] • [ 10:20:54 ]

The program is not good!
Please work for it!!
[ 14 June, 2008 ] • [ Ciccioformaggio ] • [ 12:25:51 ]

@Ciccioformaggio

Please give some constructive criticism, like what exactly you found that didn't work well. What you just said doesn't help the developer and will not get your problem fixed.
[ 14 June, 2008 ] • [ m-p{3} ] • [ 19:49:52 ]

nice program
[ 15 June, 2008 ] • [ martik ] • [ 01:59:54 ]

This Is Great.... I was looking for a App like this that was not running all the time and I could use to eject my Ipod......thx
[ 15 June, 2008 ] • [ Wid ] • [ 19:57:03 ]

If EjectUSB isn't reliably ejecting your drive, please feel free to leave a message here stating as much and include the version and language of Windows you're using.

Consider downloading one of the ejection helper utilities listed in the EjectUSB documentation; I personally use RemoveDrive (which I've successfully used on XP and Vista). I only rely on EjectUSB's ejection routine when using Win98SE; all of the ejection helper utilities listed in the documentation eject a drive via the Windows API while EjectUSB manipulates Windows' Safely Remove Hardware mechanism via macros.
[ 16 June, 2008 ] • [ William Hedrick ] • [ 02:01:35 ]

Amazing
[ 20 June, 2008 ] • [ Professor ] • [ 05:26:52 ]

Eject USB is excellent portable
[ 20 June, 2008 ] • [ Tani ] • [ 15:10:08 ]

Excellent application. It's the most usefull portable I have on my flashdrive. GREAT GREAT GREAT WORK! Thank you for this!
[ 20 June, 2008 ] • [ f1xxx3r ] • [ 16:49:14 ]

thanks for this great program!
[ 20 June, 2008 ] • [ dude ] • [ 21:52:54 ]

nice work , i use it , but in windows vista after run this software some process display on screen like send watch icon dispaly in notification area this is good
but also my moniter screen blank for some neno seconds.

if you hide some process .
i think this is best software after it

thanks for this free software
[ 22 June, 2008 ] • [ ashish ] • [ 04:15:59 ]

IS VERY NICE

WHAT CAN I DO WITH FOLDER Source Code?
CAN WORK Eject USB WITHOUT » Source Code?
[ 05 July, 2008 ] • [ TAN ] • [ 06:47:47 ]

This is great. I would love to see support for truecrypt container drives. i.e. Shutdown all applications running in Truecrypt mounted drive, unmount truecrypt volume, and exit.
[ 05 July, 2008 ] • [ gig ] • [ 07:44:54 ]

@TAN, You do not need the source code for EjectUSB to work; it's there so you can ''compile'' it yourself if desired.

@gig, I'll look into TrueCrypt support. I don't expect it to be too difficult to implement.
[ 05 July, 2008 ] • [ William Hedrick ] • [ 08:43:06 ]

Very nice app!

I am having a small usage problem with it. At home I use a card reader and at work I use direct usb (I have one of those Sandisk SD with USB cards). On my work machine I want all my apps and directories to close and the drive ejected. At home, I want all the apps and dirs to close, but no ejection to occur. If an ejection does occur on a card reader, the whole card reader is ejected from the system and I have to reboot to get it back.

Would there be a way to make EjectUSB detect if a drive is connected through a card reader and not perform the ejection? (If a usb mass storage device has multiple volumes hanging off of it, it is most certainly a card reader.)

Alternatively, would it be possible to specify an .ini file on the command line? A batch file could then be used to detect the hostname and launch EjectUSB with different .ini files to get different behavior.

Thanks!
[ 05 July, 2008 ] • [ Joe Stadolnik ] • [ 09:05:30 ]

At the very least I'll add command line support for specifying an INI file. I may also add command line setting overrides as well (for example, /noeject would supersede the setting in the INI file so while you'd still need the batch file, you wouldn't need separate INI files).

Currently (v1.2) you could accomplish what you're asking for by making a copy of EjectUSB.exe and renaming it; whatever you name the executable, it will look for a matching named INI file to go with it, so you could have two separate EXEs and INIs in the same folder and a batch file to launch the one for the current situation.

However, I'd like to resolve the issue at its root and add proper support for card readers. I can't give you a timeline on card reader support because I'm not sure how complicated it will be; it might be simple, or it might require a whole seperate routine to eject just a specific card (as opposed to ejecting the entire card reader device).
[ 05 July, 2008 ] • [ William Hedrick ] • [ 09:31:25 ]

First tests show Version 1.3 (7/20/08) has apparently fixed my reported problems with 1.2 not closing QSEL. Thanks, now I can quit using 1.0.
[ 20 July, 2008 ] • [ Steen ] • [ 11:01:43 ]

Hello,
Do you have an example of the batch file to unmount a truecrypt partition?
There is nothing included in 1.3 distribution and no documentation!

Cool tool btw!
ty
[ 21 July, 2008 ] • [ joe ] • [ 08:36:48 ]

I'm working on the hybrid batch scripting documentation over the course of this week. I wanted to get 1.3 released since it has a couple bug fixes. Example hybrid scripts and documentation will be added as a separate download when they've been fully tested (which they basically are) and are safe and ready for public use.
[ 21 July, 2008 ] • [ William Hedrick ] • [ 10:45:35 ]

Thanks for the update!
[ 21 July, 2008 ] • [ joe ] • [ 16:22:48 ]

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

Add Comment