CD Drive Open - Keyboad Hot Key

  Random Taylor 13:43 09 May 2005

I need to program a keyboard hotkey with a small batch file to open or shut the CD Drive Tray (Door). I can't find a Batch file to do this - any ideas??

Microsoft website was no help at all and the software provided allows for everything but. They do have a help for Mac OS X users - but thats no good for me as I am on XP.

I can find some Visual Basic, but don't have the knowledge to use it yet.

Microsoft Media Pro Keyboard - allows access to and browed connection.


  pauldonovan 14:58 09 May 2005

..once you have a working batch file?

Are you open to downloading some software?


click here

Several examples in access databases (VBA - could in theory be used from a script)...but most likely of use to you is the example posted by indesisiv, who provides this executable (in a zip):

click here

which can be used from the command line - and thus from your batch file.

Hope this helps, let me know.

  DieSse 15:04 09 May 2005

As an alternative, you could always put a shorcut to the drive on the desktop - then a right-click will bring up the context menu with eject in it

  DieSse 15:06 09 May 2005

Does not the media pro keyboard already have an Eject button??

  Random Taylor 15:21 09 May 2005


Thanks for the suggestions:

Media Pro does not have the CD Open / Close unfrotunatly.

Eject function Ok for normal work, but not when installing new software, multiple discs - as all software is these days.

VB function - I am little green and although I did get Visual Basic Stuio last week, I have not had chance to learn it yet. I suppose I need to create an .exe file then instead of batch point the key at that. The boolean function should allow me to open / close CD Draw at will.

I will give it a go, Thanks - but will leave the message open as I think there must be a more elegant way.


  Random Taylor 15:27 09 May 2005

Thanks Paul,

But the .exe is not working.

My original keyboad had a lovely button with opne/close which worked great - (Including on screen prompt) but skicky keys means the change.

  Random Taylor 15:27 09 May 2005

Thanks Paul,

But the .exe is not working.

My original keyboad had a lovely button with opne/close which worked great - (Including on screen prompt) but skicky keys means the change.

  pauldonovan 16:35 09 May 2005

..does it give an error? You can't just run it from windows as it will kick-in in a dos window with no params, then close.

Place cdr.exe somewhere on your C drive (say in a directory called c:\utilities\cdr), then write a batch file that just has one line on it that says "c:\utilies\cdr\cdr close"

Then run the batch file!

  Random Taylor 17:13 09 May 2005

Dear Paul - I see where I was going wrong - sorry about that and thanks for sticking with it. Actually I was banking on this being Boolean and open / close function.

In fact its a one way opion - so I shall map and then apply to a button. (I did not apply Open or Close to the statment)

In the [future] - I will try and find a way of creating a boolean response to this. In the meantime this will do fine.

I thank you for all your work


  pauldonovan 08:38 10 May 2005

So by boolean you mean you run it once for on and again for off and so on? i.e. not two icons?

One idea might be that you write a batch file that when it runs renames the two other batch files so if you run it again it swaps the order. We can help with that if needed.

  Random Taylor 09:13 10 May 2005

Dear Paul

Yes - From what I can see of the actual opperation for the CD drive is that the usual state is:

If tray is open, close tray else open tray.

This would mean that the same .exe file could be used for all opperations and the keyboard button would be a single key.

I will look at renaming in the batch file based upon previous opperations. I have been using the first batch file, linked to my Messenger button (I don't like instant messenger service because it interupts my work too much).

The advantage with a direct connect would be an onscreen BIOS display showing CD/DVD Open/Close comment - similar to that for the volume.

I will work on it,



This thread is now locked and can not be replied to.

Elsewhere on IDG sites

AMD Radeon Adrenalin release date, new features, compatible graphics cards

Inside the iMac Pro - Apple's most powerful Mac yet

iMac Pro release date, UK price & specs

Comment nettoyer Windows et optimiser son PC gratuitement ?