Page 1 of 1

Controlling the door of a CD/DVD drive

Posted: Fri Sep 07, 2012 2:20 am
by revRider
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

Re: Controlling the door of a CD/DVD drive

Posted: Fri Sep 07, 2012 9:55 am
by AndyP
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.