Not often you see me asking for help....but


OSNN Senior Addict
I have a shuttle Pc with a Stealthed CD-RW (looks much cooler) but i have to use a 3rd party programme called Cd Eject 2002 which is ok...but if i can do without it the better it is for me.

I have noticed that when i right click my cd-rw i have the options to eject and close the cd-rw door (knew about the eject part just never noticed the close command as well!)

So my question is..If i can open/close my cd-rw with the use of a few mouse clicks can i somehow assign a hotkey to do the job (thus eliminating cd eject2002) instead of having to use the mouse ?.

I have looked around and not found anything if you know anything can you pass it on.

The commands must be somewhere in windows to control the function but it seems to be hard to find.

Perris Calderon

Staff member
Political User
here's the vb script from that prank

MsgBox "Click here to recieve a free cup holder",64,"Your free Cup holder"
Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
Next ' cdrom
End If


You can also use computer management to add "removable media" to your PC it gives you the option to inject, or eject a CD


OSNN Senior Addict
Thanks for the replies but i wanted to get away from using 3rd party software to eject/close my cdrom tray....i am not sure how to use/modify the vb script for my use so if someone can explain it to me i would give it a try...and on the subject of "removable media" is this also hotkey-able for ejecting/closing the cd tray ?.

The command for open/close cd tray is in windows somewhere...i will find it:happy: .Again thanks for the replies.


I am curious what that command is also.... I looked but I dont know what I am looking for ... wheather it is an *.exe or *.pif or whatever??


I would go with the utility (eject.exe) posted by mbx. You wouldn't really consider a 12 kb command line utility 3rd party software?
Anyway the download comes with the sourcecode included. Perhaps you can get some hints from there.
Assuming you are running XP, you can change the VisualBasic script to this.

Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection

Save those three lines as something.vbs. You can create a shortcut to it then give the shortcut a shortcut key combo to run it. This should eject the first CD drive on your computer. Change the 0 to a 1 on the last line if you want to eject a second drive. It won't close the tray for you tho. :huh:


This script works to open the cdrom drive, but it also starts an extra process wscript.exe that uses resources (about 10 mb of ram) and keeps running even when the drive is closed again. You have to kill it from taskmanager.

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
What a long strange trip it's been. =)

Forum statistics

Latest member