Controlling the door of a CD/DVD drive

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
revRider
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 49
Joined: Sat Apr 02, 2011 4:06 pm

Controlling the door of a CD/DVD drive

Post by revRider » Fri Sep 07, 2012 2:20 am

Good Day...

Was wonder if anyone knew of a way to control a computers CD/DVD drive door? We need a way to open and close the door on the drives remotely, we can handle the remotely part, but not the opening and closing part (in live code).

It is for use in Elementary schools with PC's. (We handle it on Macs through ARD).

~David

AndyP
Posts: 634
Joined: Wed Aug 27, 2008 12:57 pm
Contact:

Re: Controlling the door of a CD/DVD drive

Post by AndyP » Fri Sep 07, 2012 9:55 am

Hi David,

There's no LiveCode command to directly control a cd tray, however...
you can use vbScript. :)

Place a button.
Add this to the mouseUp

on mouseUp
do the cOpenTray of me as "vbScript"
end mouseUp

Create a Custom Property for the button named cOpenTray

Put this in the Custom Property Contents

Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
For i = 0 To colCDROMs.count-1
colCDROMs.item(i).eject
Next
oWMP.close

Only tested on XP.
Andy .... LC CLASSIC ROCKS!

Post Reply