USB Disk Ejector
By Bgbennyboy
Version 1.1
Http://quick.mixnmojo.com

New in this version:

- Now works on Windows Vista.
- Changed to 'silent ejection' by default. There are now no messages shown when a device is successfully ejected, messages are only shown when there is an error and the eject fails.
- The keyboard can now be used to eject drives (press enter).
- Completely reworked the command line options, the old ones were removed and new ones added. See the rest of the readme for more information on these.
- Drives can now be ejected entirely from the command line. You can specify a drive letter, drive name, or partial drive name.
- Mobile mode has been removed, its now automatic. The program will restart itself in mobile mode when appropriate.
- Completely rewrote the drive scanning code. USB devices that dont identify themselves as removable disks can now be managed by the program.
- Uses Vista fonts when running under Vista.

What is USB Disk Ejector?:
A program that allows you to quickly remove USB devices in Windows. It was originally designed to remove only USB pen drives but will now eject any USB device. It can be run as a non-visual command line program or a normal gui program.
The command line options are very flexible, they can be used to:

- Eject the drive that the program is running from.
- Eject a drive by specifying a drive letter.
- Eject a drive by specifying a drive name.
- Eject a drive by specifying a partial drive name.

Its very useful if you have a USB flash/pen drive, especially if you use a menu such as PStart or the Portable Apps launcher. With one click the menu will exit, the program will run silently and the drive will be ejected. See the 'Command Line Options' section below for more information.
When run as a 'normal' GUI program the tools enables USB devices to be quickly ejected through a mouse click or keyboard press. It's especially useful when dealing with multiple USB devices and for Vista users who don't want the 'now safe to remove this device' dialog box to appear.
The program was designed for and has been tested with WindowsXP and Windows Vista. Windows 98/ME/2000 are not supported (this may change in the next release).

What do I need to use this?:
A removable USB device, such as a pen drive, digital camera or IPod.

Using the program (without any command line options):

1. Load the program, if you have any removable USB devices they will be shown in the list.
2. If you plug in any additional devices while the program is running then the list will automatically update to show them.
3. Double click on a device to remove it.
   A message will only be shown if there is an error and the device cannot be ejected. The 'it is now safe to remove this device' message will not appear. This behaviour can be changed with the 'SHOWEJECT' command line option. See the 'command line options' section below for more information.
4. Unplug the device from your computer.

Command Line Options:

The following command line options are available:

- /?
  Displays a dialog that shows all command line options.
- /SILENT
  Stops balloon messages from appearing when the program is run in GUI mode.
- /SHOWEJECT
  Shows the standard ''It is now safe to now safe to remove'' message when a drive is ejected. This message is disabled by default.
- /REMOVETHIS
  Ejects the drive that the program is running from. Eg if the program is run from a usb stick on drive G then drive G would be ejected.
- /REMOVELETTER
  Ejects the specified drive letter. Eg /REMOVELETTER G
- /REMOVENAME
  Ejects the drive with the specified name. Eg /REMOVEDRIVE "Sandisk U3 Titanium"
  Partial name matching is possible if a wildcard (*) is used. Eg /REMOVENAME "*SANDISK" would eject a drive that had Sandisk in its name.

The REMOVETHIS, REMOVELETTER and REMOVENAME parameters are command line only. Ie. when they are used the program will run silently, with no window appearing. There will be no feedback from the program and a message will only be shown if there is an error and a device cannot be ejected.

The command line options may be combined, eg:

- /SILENT /SHOWEJECT - would run the program in GUI mode, but no balloon messages would be shown and the eject message would be shown.
- /SHOWEJECT /REMOVELETTER F - would eject drive F without any window appearing and the eject message would be shown.

Additional Features:

Mobile Mode: If you try and eject the drive that the program is running from then the program will restart itself in mobile mode.
It copies itself to the pc's temp folder, ejects the drive, then closes and deletes itself. It means that you can run the program from a usb pen drive and then eject that pen drive.
IPod Eyecandy: If you have an IPod connected via USB, then it will have an IPod icon instead of the usual disk icon in the program.
Minimize to Tray: If you minimize the program, it will minimize to an icon in the system tray and wont show in the taskbar until restored.

Limitations:

- There is no message when a device has been ejected. Messages only appear when there is an error. This is by design since it speeds up the ejection and stops the 'safe to remove' dialog box appearing in Vista. The SHOWEJECT command line parameter 'fixes' this.
- The following only applies if you use the SHOWEJECT command line switch to show the safely remove message:
  If you have balloon tips turned on in Windows XP then Windows shows a balloon tip when a device is removed ("device x can now be safely removed from the system"). If you remove one device and then try to remove another, the second device will not be removed until you close the balloon tip. If this irritates you, then you can try disabling balloon tips altogether. See this link for information on how to do this.

Acknowledgements and Thanks:
Ejection code is based upon C code by Uwe_Sieber.
Program and drive icon is from the Snow.E2 set by Sascha Höhne.
'No drives' icon is from the Gant set by Paul Davey aka Mattahan.
Ipod icon unknown - please contact me if you are/know the author.
Uses the Project JEDI 'Setup and Config Manager API'.
C to Pascal Converter by Ural Gunaydin was used to translate much of the C code.

Disclaimer:
The software is provided "as-is" and without warranty of any kind, express, implied or otherwise, including without limitation, any warranty of merchantability or fitness for a particular purpose. In no event shall the initial developer or any other contributor be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever resulting from loss of use, data or profits, whether or not advised of the possibility of damage, and on any theory of liability, arising out of or in connection with the use or performance of this software.

Support:
Contact me

bgbennyboy 03/11/07