Quick And Easy Week – Day 7: USB Disk Ejector

Quick and Easy week comes to a close with the USB Disk Ejector.

This was originally a program that I wrote for my own use and released just to see if anyone found it useful. Apparently people did and it was surprisingly popular.

In response to user requests I’ve now beefed it up significantly. This new version has been completely re-written and has many new features. It now works on Vista, can run as a command line application and can eject drives from the command line based on drive letter, drive name or partial drive name.

The new command line options make it especially suitable for use with a flash/pen drive, especially if you use a menu such as PStart or the Portable Apps launcher. Eg. I have PStart setup to run the program with the command line option “/EJECTTHIS’. When I run it, the program loads silently, ejects the pen drive and exits. This works regardless of the drive letter that Windows assigns the drive. I strongly recommended that you check out the readme for more information on the new command line options and how they can be used.

New in version 1.1:

  • Now works on Windows Vista. It’s only been tested on XP and Vista but should work with earlier versions of Windows too.
  • 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.

Download it here.


USB Disk Ejector

38 thoughts on “Quick And Easy Week – Day 7: USB Disk Ejector”

  1. Uwe’s site is really a great resource, and i’m glad someone took those ideas and implemented them in a tool such as USB Disk Ejector.

    *Tip: Grab Winkey from here:
    http://lifehacker.com/software/keyboard-shortcuts/download-of-the-day-winkey-154444.php
    And assign a hotkey (in my case is WIN S), and no need to click, just use a hotkey. 😉

    Altough hotkey support would be more than welcomed.

    Thanks for this great tool!

    Edit: I think after you dobule click on an item, the windows should close automatically after it has removed the drive.

  2. Since i start USB DiskEjector with the WIN+S hotkey, the best practice would be exiting.

    But if you implement hotkeys on the app itself later on, then minimizing it on the tray would be a solution as well.

    My idea is for exiting in order not to stay resident (RAM usage). That way you only call the app when you eject a drive.

  3. If you know what drive letter or device name you want to eject you can do that via the command line options – these are really powerful – see the readme for more info.

    The removethis, removeletter and removename parameters are all command line only and for each the program exits after ejecting the device. It sounds like you’d be best just modifying your hotkey to call the app with parameters.
    Eg Usb_Eject.exe /REMOVELETTER F
    or
    Usb_Eject.exe /REMOVENAME “*SANDISK”

    I did consider implementing hotkeys, I’ll look at adding this in a future version. Thanks for your feedback on this.

  4. No problem. Thank you for listening.
    This app is worth of adding feedback actually.

    The command options are very powerful indeed, but the problem is that i use many many flash drives, music players, so it’s hard to make shortcuts for each one.
    Therefore the window listing all the drives comes handy.

    P.S. Has this app been featured on Lifehacker.com or downloadsquad.com ?
    I think it deserves attention.
    I’ll send those sites an e-mail today.

  5. Thanks for that! I never get around to submitting my apps to places like that.

    From what you’ve said it looks like you want a ‘minimise to tray after eject’ option and a ‘close after eject’ option. I’ll certainly look into those. It will probably take the form of checkboxes in the program and new command line switches to enable the options when the program loads (I’ve tried to keep away from using an ini file)

  6. I’ve been looking for a program like this for a while to fulfill a few needs:

    1) Avoid opening iTunes to eject an iPod with disk use enabled.

    2) Small memory footprint.

    3) Run from a portable device.

    4) Able to kill any running programs installed/running on a portable device.

    I have no idea what it would take to implement a more functional tie-in with iPods, but that would be a great feature.

    Visually, there isn’t a single thing it needs – great job on the K.I.S.S. approach!

  7. Thanks for your comments DogHead. Just to clarify a few things:

    You can eject an ipod using windows’ eject applet in the task bar – you don’t necessarily need itunes or this software to do that. However you could use the program to create a shortcut to eject it quickly – something like disk_eject.exe /REMOVENAME ?Apple Ipod?

    Also, it cant kill any programs running on a disk – if something is still using the disk it’ll tell you, but it wont list what programs are using it or let you kill them. That’s a possible feature for a future version.

  8. Sorry, I hadn’t realized that iPods aren’t supposed to be ornery with Windows’ eject option – I’ve since found this to be quite nice, but I have no idea where or how to use the command line options. The “EJECTTHIS” option seems to be exactly what I’m looking for.

  9. Its working for me Jon. Perhaps there was a temporary server problem. Try it again now.

    DogHead – EJECTTHIS removes the drive that the program is running from, so if you’re running it from your ipod then that should do the trick. The other alternative is the /REMOVENAME ?Apple Ipod? option that I mentioned earlier – this will remove any drive that has the name Apple Ipod.

  10. Yeah, I understand what the modifiers are supposed to do, but I have no idea how to use them. Do I need to make a .bat file or alter a shortcut somehow?

    This is a new concept for me.

  11. Ah sorry. You can do it with both.
    With a shortcut: Right click the shortcut, click properties, in the target box put a space after the name of the program and put the command line switches there. So the target box reads something like:
    E:\USB_Disk_Eject.exe /REMOVENAME “Apple Ipod”

    You call it the same way in a bat file. If you need help with this you can contact me via my contact page and I’ll help via email. Hope that helps.

  12. Great program.

    Is there any way I can mod the icons in the program? I kinda like the icons that are in it currently but I have some ideas and some icon packs that could make the icons more uniform.

  13. Thanks Jeton, you generated massive interest with your submissions, thank you!

    Lazy: Its currently only possible by recompiling the program. I could add a feature to add/change icons but its yet another requested feature that would move the program away from a one file simple program. Let me know what you’re thinking of though, either here or via my contact page and I’ll look into it.

  14. I was thinking that you could make the icons that are used embedded in the program as ico files. That was peole could use ResHacker or some other program to replace the icons and resave the program with the new icons. I don’t think it would make the file bigger or anything.

  15. Or maybe you can make it read from desktop.ini, where the user has set up a specific icon for the drive.

    Here’s my desktop.ini file on my Sandisk CRUZER as an example :
    [.ShellClassInfo]
    IconFile=S:\icon\Folder Music Alt 4.ico
    IconIndex=0
    ConfirmFileOp=0

    I think this won’t rquire inserting icons in the program, but still you know better 🙂

  16. Mmm, maybe a dumb question, but to run the program, is it necessary to click on the app every time? When the window is open, there is an icon in the tray that goes away when it’s closed. Should the program load on startup? Perhaps I didn’t quite understand the .doc that came with it, but to me, it would be very beneficial if it loaded automatically loaded on startup. I use quite a few USB drive sticks and I think it would simplify things if all I had to do was bring up the app from the tray.

    Thanks

  17. It isn’t designed to load on startup really, it was designed to be used portably. Someone has requested that feature before though and I’ve added it to the list of requests for the next version.

  18. It would be a very nice idea putting the device label por identifying two or more identical devices when trying to remove only one of them.

  19. Well, I had no luck using USB Disk Ejector 1.1 running USB Disk Ejector 1.1 on Windows 98, I would like to find a USB Memory Stick Ejecting program aka (Mass Storage Device) that works with 98, I think I did see one out there before though…

  20. I downloaded Disk ejector but for some reason cannot get it to work. When I double click I get the following message “Access violation at address 00000000 Read of address 00000000. If anyone has any idea what is wrong I would appreciate a solution. I am using Microsoft 2000 and maybe its not supported?

  21. Darrell: The problem is that the program doesn’t work with Windows 98/ME/2000. It wasn’t tested for or designed with these older versions of Windows. I tried to write it so that it *should* work with these and I did have a tester who told me it worked on Windows 2000. It now appears that this was false and it doesn’t work with any of the older versions of Windows.

    ME/2000 support is on the list of possible features for the next version ( https://quickandeasysoftware.net/files/USBEjectIdeas.txt ) and I’ll try and get it working, but I cant guarantee anything.

  22. This is great, however I want to load it from a dock which is running from my pendrive. Could you add a /force argument so that the app forces all processes running from the pendrive to close and then ejects the drive?

  23. Its on the todo list but I’m finding it quite difficult to do. There doesnt seem to be a good way of finding whats running from a drive. So it may not be possible I’m afraid.

  24. just make a shortcut to the .bat below and make a /force argument

    Oh, and !OBJECTDOCK RULEZ!

    If you just type
    “Usb_Eject.exe/REMOVETHIS
    exit”(without quotations & make sure exit is below the command)
    in a .bat file and put it in a USB with the program It’ll work automatically

  25. Another vote for Windows 2000 support, please! This OS is still in Extended Support, and barring an extension from Microsoft, will remain as such until the summer of 2010.

  26. I’m investigating this issue at the moment. Do you have any mapped network drives? I think this issue occurs when it tries to scan a network drive that isnt connected or it cant access.

  27. Would it be possible or even difficult to add and “Eject all” option? I know this would be a boon for laptops. When I plug in my USB hub, I have to unplug 4 or 5 things just to get up and go. An Eject all Option would be fantastic!

Comments are closed.