Windows – Eject CD-ROM drive from Windows 7

autohotkeywindows 7

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

Best Answer

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: