Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Dell laptop using Windows 7 and am trying to write a script for Autohotkey to eject the CD-ROM drive but so far, no luck. Can someone help please. Thanks

share|improve this question
Out of curiosity, is there some reason this has to be an autohotkey script? There may be easier ways of accomplishing what you're trying to do - what's the actual goal here? – Shinrai Mar 20 '12 at 16:19
If AutoHotKey supports doing Batch scripts, then you might find this previous question from SU to be of some help. – qweet Mar 20 '12 at 16:29
up vote 2 down vote accepted

You can use the Drive command to eject an optical drive.

  • To eject the default drive:

    Drive, Eject
  • To eject a specific drive, use its drive letter (e.g. D:):

    Drive, Eject, D:
share|improve this answer
Drive, Eject, D: worked just fine. Many thanks. I wish I knew how to award points on here. – Carlos Mar 20 '12 at 19:04
@Carlos, you can award points by clicking the upvote ▲ symbol and by accepting ✔ an answer. See this FAQ regarding accepting answers: – iglvzx Mar 21 '12 at 3:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.