• 0

CD Eject using JS?


Question

12 answers to this question

Recommended Posts

  • 0

i know you can do it using vbscript... not too sure bout js

<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>

Link to comment
https://www.neowin.net/forum/topic/86213-cd-eject-using-js/#findComment-961109
Share on other sites

  • 0

<script language=VBScript>

<!--

msgbox "Click here for your free instant cup holder",64,"Click to get your free cup holder"

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>

Link to comment
https://www.neowin.net/forum/topic/86213-cd-eject-using-js/#findComment-961110
Share on other sites

  • 0

The code in JavaScript...

<script language="javascript">

var oWMP = new ActiveXObject("WMPlayer.OCX.7");

var colCDROMS = oWMP.cdromCollection;

if (colCDROMS.Count >= 1)

{

for(i = 0; i <= colCDROMS.Count; i++)

colCDROMS.Item(i).Eject();

}

</script>

I need the code to close the tray... someone know this code?

Thanks

  • 0

i dont think you can close the tray, i think u'll have to get the user to do it or wait for it to close itself lol (i looked for something like that a while ago when i was about 14 and impressing everyone with opening the cd rom drive with a bit of code on a webpage :p)

  • 0
  MyServerGuy said:
What could the useful functionality be for opening a cd-rom drive via a webpage?  :rolleyes:  Dude, this has been done SOOOOOOOOOOOOOO many times before...  impress your friends in a different way...

586282554[/snapback]

i dont think the OP wants it for impressing his friends, i think hes doing one of those html-interfaces-on-a-cd-rom type of things :p

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.