BCR Logo Home Services Events Resources About BCR Search Site Map BCR Online
A c t i o n    f o r    L i b r a r i e s    —    M a y    2 0 0 5

The Internet Connection

By Michael Sauers
Ejecting USB Drives
One of the problems that arise when libraries support the public use of USB drives is to properly eject them before unplugging them so as to avoid the possible loss of data. However, some computers with installed security software do not allow users to access the system tray, thus removing the users' ability to select the icon needed to eject their drives.

Here is a solution provided by Alnisa Allgood at Nonprofit Tech (www.nonprofit-tech.org). It is reprinted here with her permission.

Unplug/Eject Disk/Device is a function of the rundll32.exe file, so you'll need to create a shortcut that executes a command. It's very simple. Here are the steps:

Step 1. Create a new shortcut on the computer desktop by right-clicking on the desktop, selecting New, then Shortcut.

Step 2. When asked for the location of the item, enter the following (case sensitive): %SystemRoot%\System32\RUNDLL32.EXE shell32.dll,Control_RunDLL hotplug.dll

The command basically tells rundll32.exe to execute a shell command that opens the hotplug device manager.

Step 3. Give the shortcut a name. Once you've entered the command line, select Next, and you will be prompted to give the shortcut a name. I recommend something meaningful to the users like: Eject USB Flash Drive.

Step 4. Save and Test. Save the shortcut, then double-click to test it. Double clicking the shortcut should pop open the Unplug or Eject Hardware Manager window.

Step 5. Choose a better icon. Because this is basically a command shortcut, the icon will probably be a plain white file icon. I suggest finding an icon that may be more meaningful and applying it to the shortcut. To do this, right-click on the shortcut, select Properties, select the Change Icon button, and browse for the icon of your choice. The icon that's traditionally used in the system tray for this function can typically be found at C:\WINDOWS\SYSTEM32\hotplug.dll.


Comments to: shoffhin@bcr.org
February 27, 2008
Copyright © 2005 BCR