Create a Shortcut or Hotkey to Eject the CD/DVD Drive
After writing articles about how to open the Safely Remove dialog as well as eject a specific USB drive, some readers contacted me asking me to write about how to eject a CD or DVD drive instead, so I’m covering that here.
There’s a number of ways to accomplish this, but the best way is to use the NirCmd utility from the excellent Nirsoft. It does a lot more than just eject the cd-rom drive, so be sure to read the information on their site about all the capabilities.
Create a Shortcut to Eject the CD/DVD Drive
Right-click on the desktop or elsewhere and choose New \ Shortcut.

In the location box, put the full path to the nircmd.exe file that you downloaded, and append the “cdrom open” command to the end of it, adjusting the drive letter to match your disc drive:
“C:\path\to\nircmd.exe” cdrom open D:
Note the location of the quotes.. if you are using a path with spaces in it, you need to make sure the quotes are only around the path to the executable, and the arguments should be placed after the quote.
Give the shortcut a meaningful name, like Eject CD or something like that, and you’ll have a new icon (read below on how to use the cd-rom icon as shown)

You can move the icon to anywhere you’d like… double-clicking on it will immediately eject the drive.
Create a Shortcut to Close the CD/DVD Drive
You can follow the same exact instructions as above, but instead of “cdrom open” just substitute “cdrom close”.
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.
Assign an Icon to the Shortcut
If you click on the Change Icon button in the properties window, you can give the shortcut a more meaningful icon, perhaps the DVD one you see below.
You could choose any icon on the system that you’d like, of course.

Daily Email Updates
You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


Don’t work for me, when i execute the shortcut there comes a popup window with the nircmd info, and the cdrom doen’t open
fixed
@alexfel:
What did you use as the location for the shortcut?
Thank you!
This came at a fantastic time!
Great shortcut idea!
Nircmd is great, but, Is there another way to do the same but using only builtin Windows commands?
Thanks
Yea I’ve been using this same trick for a while now….make a shortcut, put it in the quick launch and hit the Win + 5 to open and Win + 6 to close.
I am a bit sick of how How-To Geek is going too Windows centric. Honestly!
How-To do the same in Linux:
http://www.dailygyan.com/2008/.....eject.html
@Anoop
I have been writing more Windows content lately than normal… of course 90% of the readers of this site use Windows, so I get complaints when I write Linux content as well. I can’t win!
You can do that and much much more with PowerPro 4.8 (FREEWARE)
For example: you can make your own taskbar(far better then windows), build menus, use hotspots(screen corners,edges,titlebars etc.) for actions, you can have just one hotkey for many actions depending on the foreground window , then you can ….
Warning: Help file is like a book so if you don’t have patience you will hate this app.
I discovered this app recently ( why, why, why??? ), although it’s in development for ten years, and now I am spreading the word …. people must know !!!
Great tip. I was looking for this a while back. The solution I found that works for me is a different little freeware utility called “Hotkey CD Eject” from the Mars9 website, http://mars9.com/downloads/freeware/
This utility just does one thing — eject or close CD/DVD trays. It sits in your system tray, allows you to assign hotkeys, and can autostart with Windows. I have had no compatibility problems with it under Vista.
I mad a AHK script for this, long ago…
;Created by Oliver
; oliver.lipkau@gmail.com
#NoTrayIcon
FileSelectFolder,Driveletter,::{20d04fe0-3aea-1069-a2d8-08002b30309d},0,Pick a drive:
if Driveletter =
return
StringTrimRight, Driveletter, Driveletter, 1
Drive, Eject, %Driveletter% , 1
ExitApp
You don’t need any software, just Windows. Press and hold the Windows key. While holding the Windows key press the E key and release both. After Windows Explorer opens quickly press and release each of the following keys in succession: C key, Application key, and J key. If you have a DVD drive then change the C key to a D key. Or if you have a disk in the drive change the C key to whatever the title of the disk is. Most keyboards have the Windows key and Application key but if yours does not then just open Windows Media Player, press and hold the Ctrl key then the E key.
OMFG.. this was uber easy hehe.. ur the best man..
So is there a command line parameter we can give the shortcut in explorer that ejects the CD/DVD or not ?
How do the little apps that do it work ? Do they do more than land a command wit a special command line parameter ?
Would be nice to have a listing of ALL command line parameters for explorer…
If all you are doing is ejecting the disk, why not just open windows explorer, right click on the drive and select eject?
why go through all that trouble when you can simply right click Computer,select send to,select quick launch?
now,click Computer in quick launch,right click disk drive (e),select eject
you can also create a personal Control Panel by creating a folder in Documents. open that folder and select from the left tree,all the options from Computer and Control Panel. close and save folder. right click folder and add to quick launch. my personal control panel has downloads folder,ease of access,update,performance & information,personalization,programs and features,prefetch and cd drive.
no more going to start and wherever. it’s right in my quick launch
Way Cool Stuff The eject cd worked great Thanks…
Excellent!!! I was ready to rip my Vostro desktops doors off ( thanks Dell for an idiotic engineering design that hides the DVD’s button when a totally unneeded door is open ). This makes things tolerable. Thanks!!!!
nice…. here is my tip: put the ejectCD shortcut in your shortcuts directory and then you can launch it with launchy
This really is the best site – well done, uber Geek!
I wish PCs had a simple CD eject key like Macs have. Surely somebody can either make a toggle open/close shortcut, or even map it to the kayboard – I mean, how many of us use the F12 key?
I have a Dell Vostro 200 which was recently formated by their techs. They erased my shortcut to open and close my D: Drive. The shortcut was on my desktop on top of all my work. It’s a Icon of a CD-Disk, one inch by one inch. When I mouse click on the icon a ruler slides out from this Icon to give me a few options to choose from such as click to open, click to close, view, copy, etc. I went as far as having tech come into my computer to see what’s going on. The Roxie Creator is not what I want. Although, it will open and close CD Drive, it takes too long to wait and it takes up a lot of screen. No Dell tech or even at the shop could help me get back my Icon that can do it all and very quick about it. I’ve search my software “Utility & Drivers” but just don’t know what to look for. I can’t believe that Dell doesn’t know what the heck I’m talking about. This feature came with my computer when I purchased it in Jan 2008.. which is still under Warrenty. I miss this 1″ x 1″ Icon that can go behind or infront of my work. I design Card and that D: Drive is constantly opening and shutting. Does anyone know of this feature?
Thanks,
grace
@grace: The only thing I can think of is the Roxio Drag-to-Disc icon. There is a picture of it at http://www.itg.ias.edu/dragtod.....vdcreator9
Is that it? Or is it the “The Roxie Creator” you said you don’t want?
Ok It worked!
But I have to make a note:
I have DaemonTools establishing virtual drivers. So in this case my DVD drive is E:
Be smart with it.
Another thing is that you can not forget to put a space after the quotes and then put
cdrom open D:
Tnx all
hm…you could simpy go to Start Button, Computer, DVD DRIVE, right click and EJECT……..and put a shortcut on your desktop…
Great tips; worked well for me. How do you get those shortcuts off of the desktop and into your system tray?
I am trying to use this procedure in conjunction with a Dell RD1000 ejectable backup media drive. I have been unable to get it to work, have you any ideas? GC
I’s there a way to make the cd open command time out, and auto close the cd-rom?