![蓝天热键驱动](https://i-blog.csdnimg.cn/blog_migrate/b45229df9a9d9fae6250524006a1ae4a.png)
蓝天热键驱动
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.
使用内置的Windows对话框功能更强大,对于大多数人来说可能就足够了,但是对于我们这些想要完全控制的人来说,有一个名为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.
注意:此实用程序仅适用于弹出USB设备,因此,如果需要弹出另一种类型的设备,则必须使用Windows方法。
Using USB Disk Ejector from the GUI
从GUI使用USB磁盘弹出器
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.
这个实用程序真的很漂亮……启动它,然后双击或在您要弹出的USB设备上按Enter。 字面上没有其他内容。
![image](https://i-blog.csdnimg.cn/blog_migrate/3479e866b53aa91db7a808e7685fe2c5.png)
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:
您可以通过输入/开始。 参数以显示帮助对话框:
![image](https://i-blog.csdnimg.cn/blog_migrate/b7e4ad75f6328d3d969cafcbd6d2779c.png)
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:
既然您知道命令行选项,就可以对其进行测试……例如,我的闪存驱动器已安装为G:驱动器,因此我将使用以下语法:
usb_disk_eject /removeletter G
usb_disk_eject / removeletter G
![image](https://i-blog.csdnimg.cn/blog_migrate/253d1a84b2de42ee5ed89238885cfd96.png)
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:
如果有错误,您只会收到一条消息。 例如,如果您在未安装USB驱动器的情况下第二次运行相同的命令,则会收到此消息,该消息似乎不太准确:
![image](https://i-blog.csdnimg.cn/blog_migrate/39e6ba399a6155fefa852bb2a3495980.png)
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.
如果您的USB驱动器似乎更改了很多字母,也可以使用部分名称匹配,但是语法有些奇怪。 要检查部分名称,请在关键字的开头加上*。 不要在搜索字符串中加上第二个星号,因为它不起作用。
For instance, the full name of my flash drive is “Memorex TRAVELDRIVE 005B” so I could use the full name:
例如,我的闪存驱动器的全名是“ Memorex TRAVELDRIVE 005B”,因此我可以使用全名:
usb_disk_eject /removename “Memorex TRAVELDRIVE 005B”
usb_disk_eject /删除名称“ Memorex TRAVELDRIVE 005B”
Or I could just use *Memorex as the name instead:
或者我可以只使用* Memorex作为名称:
usb_disk_eject /removename “*Memorex”
usb_disk_eject /删除名称“ * Memorex”
Note: the /showeject parameter didn’t work for me at all under Vista, but it might work for you.
注意:/ showeject参数在Vista下根本不适合我,但它可能对您有用。
Create a Shortcut to Eject a Specific USB Drive
创建快捷方式弹出特定的USB驱动器
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.
现在我们知道了语法的工作原理,我们可以将其包含在可以从图标或热键启动的快捷方式中。 右键单击桌面或其他位置,然后选择“新建\快捷方式”。
![image](https://i-blog.csdnimg.cn/blog_migrate/355e128af0781e087a2c4c91010154b2.png)
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.
在位置框中,将完整路径放置到USB Disk Eject应用程序文件中,然后将/ removeletter参数附加到末尾,包括驱动器号。
C:\path-to\USB_Disk_Eject.exe /REMOVELETTER G
C:\ path-to \ USB_Disk_Eject.exe / REMOVELETTER G
![image](https://i-blog.csdnimg.cn/blog_migrate/54bae0f1187123364785acdcf60da432.png)
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:
您需要给快捷方式起一个合理的名称,然后您将具有一个图标,可用于立即弹出驱动器:
![image](https://i-blog.csdnimg.cn/blog_migrate/bf3ceb140549bf3c211dd397f7b10d9e.png)
Note that you could use the /removename parameter instead if you choose.
请注意,您可以选择使用/ removename参数。
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:
现在有了快捷方式,我们可以通过右键单击图标并选择“属性”来为快捷方式分配一个热键。 在快捷方式选项卡上,您将看到一个分配快捷方式键的位置:
![image](https://i-blog.csdnimg.cn/blog_migrate/b9ac7a4c2705ccc25c3de9786c2dc69d.png)
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.
提示:如果将快捷方式添加到Windows Vista快速启动栏,则可以使用内置的热键,而不必费心手动分配一个。
Download USB Disk Ejector from mixnmojo.com
蓝天热键驱动