CD or DVD Drive access on Desktop

Zenerdiode

Active Member
Licensed User
I would like to be able to send an 'Eject Media' command to an optical drive (although there are also open & close commands too) and also lock the drive; so pressing the eject button is ignored.

I thought having a file open for writing would acomplish the latter, however pressing the button opens the drive and then I get a 'delayed write failure'

Many Thanks.
 

ExcludeReality

Active Member
Licensed User
You can make a simple VBScript to eject the CD drive, and then run it from your application.
There's a small delay and it doesn't give you full control, but it was all I could think of.

The forum wouldn't let me post a .vbs file so you'll have to rename this text file to *.vbs
 

Attachments

  • Access CD Drive.txt
    190 bytes · Views: 220

mhc

Member
Licensed User
Longtime User
You are looking for something like this (attached file)?
It was written in Delphi.
I'm not sure whether B4PPC can handle mciSendString commands.
And what's about WM_ messages and API commands?

Please note that right clicking on the icon in the tray will show a small popup.
You can select locking the CD-Caddy. But this will only prevent to open the caddy via the icon in the tray. Not openning the caddy with the hardware button.
 
Top