Zabaware Support Forums
Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: moreis62 on February 25, 2006, 01:37:28 pm
-
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>
-
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]
-
Thanks in advance
Jerry[8D]
-
You can download my cd-rom controller here:
http://www.zabaware.com/forum/topic.asp?TOPIC_ID=3026
Jerry[8D]
-
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.