Zabaware Support Forums

Opening and closing DVD or CD rom drives

Started by moreis62, February 25, 2006, 01:37:28 PM

Previous topic - Next topic

moreis62

Does anyone know how to close a cd rom drive using Javascript or VB, i fund a script that will open them, however i need one that will close them if they are open

can someone help!!

Thankyou in advance

Vasilli

VB script to open CD drives

' VB Script
<SCRIPT language=VBScript>
<!--

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

if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next ' cdrom
End If

-->
</SCRIPT>

ISMAEL LEDESMA.

onthecuttingedge2005

#1
quote:
Originally posted by moreis62

Does anyone know how to close a cd rom drive using Javascript or VB, i fund a script that will open them, however i need one that will close them if they are open

can someone help!!

Thankyou in advance

Vasilli

VB script to open CD drives

' VB Script
<SCRIPT language=VBScript>
<!--

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

if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next ' cdrom
End If

-->
</SCRIPT>





Hi moreis62.

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

don't support closing a CD-ROM.

But, I have written a script that will allow you to both open and close a CD-ROM, but doesn't use either of the above to do the job.

I'll post it a little later because my better half wants to head for the beach for awhile, see ya in a bit.

Jerry[8D]

moreis62

ISMAEL LEDESMA.

onthecuttingedge2005


Charmzbond

quote:
Originally posted by moreis62

Does anyone know how to close a cd rom drive using Javascript or VB, i fund a script that will open them, however i need one that will close them if they are open

can someone help!!

Thankyou in advance

Vasilli

VB script to open CD drives

' VB Script
<SCRIPT language=VBScript>
<!--

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

if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next ' cdrom
End If

-->
</SCRIPT>





Dear moreis62/whoever it may concern

I'm wondering where in hal's brain editor script can
I paste the codes you provided above (CD Rome)...or
does it even matter? I see people sharing a lot of codes
but there's no specific indication of where interested users SHOULD
paste them.