Create a Shortcut or Hotkey to Immediately Eject a Specific USB Drive
After writing yesterday's article about creating a shortcut to the Safely Remove Hardware dialog, a number of readers mentioned to me that they'd like create a shortcut to immediately eject a specific drive, so we'll cover that here.
Using the built-in Windows dialog is more powerful and probably would suffice for most people, but for those of us that want complete control there's a small freeware utility called USB Disk Ejector.
Note: This utility only works for ejecting USB devices, so if you need to eject another type of device you'll have to use the Windows method.
Using USB Disk Ejector from the GUI
This utility is really quite slick… launch it and then either double-click or press enter on the usb device you'd like to eject. There's literally nothing else to it.
If you assign a hotkey to the executable through a shortcut, you can operate the entire thing from your keyboard. Quite useful for keyboard ninjas!
Using From the Command Line (Advanced)
You can also use the utility from the command line, and pass parameters to tell it which drive to eject. It will work silently by default, so there won't be any popups to deal with.
You can start off by passing in the /? parameter to show the help dialog:

Now that you know the command line options, you can test them out… for instance, my flash drive is mounted as my G: drive, so I'd use this syntax:
usb_disk_eject /removeletter G
You will only get a message if there is an error. For instance, if you run the same command a second time without the USB drive mounted, you'll get this message that doesn't seem very accurate:
You can also use the partial name matching if your USB drive seems to change letters a lot, but the syntax is slightly strange. To check for a partial name, append * to the beginning of a keyword. Do Not put a second asterisk in the search string, as it won't work.
For instance, the full name of my flash drive is "Memorex TRAVELDRIVE 005B" so I could use the full name:
usb_disk_eject /removename "Memorex TRAVELDRIVE 005B"
Or I could just use *Memorex as the name instead:
usb_disk_eject /removename "*Memorex"
Note: the /showeject parameter didn't work for me at all under Vista, but it might work for you.
Create a Shortcut to Eject a Specific USB Drive
Now that we know how the syntax works, we can include that into a shortcut that can be launched from an icon or hotkey. Right-click on the desktop or elsewhere and choose New \ Shortcut.

In the location box, you'll put the full path to the USB Disk Eject application file, and then append the /removeletter parameter to the end including the drive letter.
C:\path-to\USB_Disk_Eject.exe /REMOVELETTER G

You'll want to give the shortcut a reasonable name, and then you'll have an icon you can use to immediately eject the drive:
Note that you could use the /removename parameter instead if you choose.
Assign a Hotkey to the Shortcut
Now that we have a shortcut, we can assign a hotkey to the shortcut by right-clicking on the icon and choosing Properties. On the Shortcut tab you'll see a place to assign the Shortcut key:

Add in the shortcut key and close the dialog. As long as the shortcut is on your desktop you shouldn't have to restart anything for the hotkey to work. You can also move the shortcut to another folder, for instance your quick launch bar.
Tip: If you add the shortcut to the Windows Vista quick launch bar, you can use the built-in hotkeys instead of bothering to assign one manually.


Great followup to yesterday's article!
I'm gonna use this to eject my iPod.
nice, i was wondering if that could be done after reading the first article.
I tried it but couldn't get it to work on my vista machine. The system could not find "USB_Disk_Eject.exe". I couldn't find it either.
@Wil
You probably need to extract the file from the downloaded zipfile first. Right-click on the downloaded zip file and choose to extract. Then you'll be able to use the .exe file.
Where can I find a copy of that USB drive icon?
@dix: You can grab that icon from the program itself. Use an icon extractor like NirSoft's IconsExtract:
http://www.nirsoft.net/utils/iconsext.html
I went real over board on this idea and wrote a batch file that used nircmd send a batch killprocess to every executeable on my flashdrive, running or not, and then run the drive eject so it would never fail.
for nircmd: http://www.nirsoft.net/utils/nircmd.html
Why not just left-click on the Remove Safely icon and then click on the drive that you want to eject when the menu comes up? Saves a few clicks.
Can't seem to get the shortcut to work
"C:\Documents and Settings\Kyle\My Documents\Applications\USB_Disk_Eject.exe" works fine
but adding "/REMOVELETTER M" just makes it say "… can't be found"
Kepp
To get the shortcut to work, place the \removeletter m outside the quotation marks like this;
"C:\Documents and Settings\Kyle\My Documents\Applications\USB_Disk_Eject.exe" \REMOVELETTER M
Great tip!
Now, is there a way to mount the drive without unplugging the USB cable/stick and plugging it back in? I sometimes like to unmount my USB drive and leave it plugged in. When I do this, I have to unplug the cable, then plug it back in for Windows to mount it.
http://www.safelyremove.com
the best app that i saw to do that. it creates a global hotkey too. perfect.
Ricardo,
You must work for that company. $20 for an app that does something so simple…highway robbery…
Zak,
But it's However with USB Safely Remove I can stop USB devices with keyboard shortcuts by default without performing any long instructions. Also it get rid me of a lot of annoyances appearing on frequent using of USB (ie "the device cannot be stopped right now" message).
Maybe Ricardo works on this company, then I also work for this company
Love the product!!! SLICK!