I used to use this batch to quickly run a script and eject.
FOR %%i in (".") do set usbdrv=%%~di copy deveject.exe "%userprofile%\desktop" copy startx.exe "%userprofile%\desktop" echo deveject -EjectDrive:%usbdrv% >> "%userprofile%\desktop\bye.bat" echo del startx.exe >> "%userprofile%\desktop\bye.bat" echo del deveject.exe >> "%userprofile%\desktop\bye.bat" echo del bye.bat >> "%userprofile%\desktop\bye.bat" cd /D "%userprofile%\desktop" startx /B bye.bat
Then I got a Lexar JumpDrive Secure, which appears to Windows as a Local Drive rather than a Removable Device. It has the advantage of using an autorun.inf like CDs so my apps start as soon as I insert the stick (SP2 adds a nag popup, but that's the only hold-up).
I had hoped to be able to use the Secure drive's autorun to start a script, eject, and move on without touching the keyboard or mouse.
This is not the case though. Deveject only seems to work for Removeable Devices even though the Windows Safely Remove Wizard doesn't distinguish between them.
Are there any other utilities to eject USB drives?