
EjectMedia V1.2.0 - ejects a media from a drive
Freeware by Uwe Sieber - www.uwe-sieber.de


Win32 version works Window 2000, XP and higher, including x64 editions.
x64 version works under Windows x64 editions only.


Supports removeable drives and CD-ROMs only.
The 'eject' request is passed to 'Fixed' drives too. It depends
on the drive's hardware if it is supported or not.
It usually works with USB flash drives turned into 'fixed' drives.


To prepare an external drive for 'safe removal' use my tool
RemoveDrive:
http://www.uwe-sieber.de/drivetools_e.html


Usage:
EjectMedia DriveSpec: [-l] [-d] [-f] [-s] [-h] [-w:nnnn]

DriveSpec: is the drive to remove, e.g. U: or a NTFS mountpoint like "C:\Mount\USB Drive1"
           or a volume name like \\?\Volume{8108336c-7299-11de-ac31-000102b35cc3}
           or \ for the current drive
[-L]       loop until success
[-d]       dismount only (no eject)
[-f]       force eject (not much better than just to throw out the media)
[-s]       self delete EjectDrive.exe when finished
[-h]       show open handles (admin rights required, exprimental, may freeze!)
[-w:nnnn]  wait nnnn milliseconds before close

Under XP by default admin rights are required. Since SP2 this can
be changed by a policy:
http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/96271.mspx
This reg file includes the required setting:
http://www.uwe-sieber.de/files/allocatedasd_2.reg



Returns Errorlevels:

0 - successfully ejected a media
1 - media not ejected
2 - parameters are invalid

4 - EjectMedia.exe located on the drive to remove -> temporary copy 
    created and executed
5 - invalid drive



Homepage:
http://www.uwe-sieber.de/drivetools_e.html



Licence


EjectMedia is Freeware.

Allowed:
- usage in any environment, including commercial
- include in software products, including commercial
- include on CD/DVD of computer magazines

Not allowed:
- changing any of the files


