Subscribe to How-To Geek

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.

image

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.

image

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)

image

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:

 image

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.

image

You could choose any icon on the system that you’d like, of course.

Download NirCmd from nirsoft.net

| More
This article was originally written on 03/20/08 Tagged with: Shortcuts and Hotkeys, Vista Tips & Tweaks, Windows 7, Windows Vista

Daily Email Updates

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


Name:
Email:

Comments (27)

  1. alexfel

    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

  2. alexfel

    fixed ;)

  3. The Geek

    @alexfel:

    What did you use as the location for the shortcut?

  4. Chris

    Thank you!

    This came at a fantastic time!

    Great shortcut idea!

  5. Osk

    Nircmd is great, but, Is there another way to do the same but using only builtin Windows commands?
    Thanks

  6. Premankan

    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.

  7. Anoop Engineer

    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

  8. The Geek

    @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!

  9. Torrente

    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 !!!

  10. zLensman

    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.

  11. Oliver

    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

  12. Computer Wizard

    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.

  13. Rov

    OMFG.. this was uber easy hehe.. ur the best man..

  14. bouloit

    :-)

    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…

  15. Anzals

    If all you are doing is ejecting the disk, why not just open windows explorer, right click on the drive and select eject?

  16. registereduser1946

    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

  17. Terry Donscheski

    Way Cool Stuff The eject cd worked great Thanks…

  18. Jeff

    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!!!!

  19. edgar

    nice…. here is my tip: put the ejectCD shortcut in your shortcuts directory and then you can launch it with launchy ;)

  20. Robin

    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?

  21. grace

    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

  22. jd2066

    @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?

  23. Roberto Luiz

    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

  24. jimi

    hm…you could simpy go to Start Button, Computer, DVD DRIVE, right click and EJECT……..and put a shortcut on your desktop…

  25. GoldBeachBiker

    Great tips; worked well for me. How do you get those shortcuts off of the desktop and into your system tray?

  26. George Carroll

    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

  27. T-REX

    I’s there a way to make the cd open command time out, and auto close the cd-rom?


Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Our Friends
Getting Started


About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
conhost.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. All Rights Reserved.