• 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.
  • Posts

    • OpenAI slashes o3 price by 80% in direct challenge to Gemini 2.5 Pro by Pradeep Viswanathan Back in April, OpenAI released o3, its flagship reasoning model, which delivered state-of-the-art (SOTA) results on several AI benchmarks, including Codeforces, SWE-bench, and MMMU. The o3 model also included support for external tools, such as web browsing, a Python interpreter, and more. Although o3 was the most powerful model available from OpenAI, it was not widely adopted by developers due to its pricing compared to other alternatives. Google’s Gemini 2.5 Pro model offered nearly the same performance at one-quarter of the cost, while Anthropic’s Claude 3.7 models delivered better coding performance at a similar price. Today, OpenAI is responding to developer feedback by reducing the price of the o3 model by nearly 80%. At launch, the o3 model was priced at $10 per million input tokens and $40 per million output tokens. As of today, OpenAI is lowering the price to $2 per million input tokens and $8 per million output tokens. This price drop makes o3 a much more attractive option for developers. You can refer to the benchmark comparison table below, which Google published last week during the launch of the Gemini 2.5 Pro June update, to see how OpenAI’s o3 compares with other leading models. In addition to the price reduction, OpenAI is also launching o3 Pro, its new flagship reasoning model, later today. The o3 Pro model is expected to outperform the Gemini 2.5 Pro June update on several key AI benchmarks and may be priced at $10 per million input tokens and $40 per million output tokens.
    • From my understanding.... Thunderbolt isn't like USB ... where you can simply plug a couple of TB ports into the header.  The header itself isn't "Thunderbolt" ... the header connects to the add-on Thunderbolt I/O card for management. I'm sure Nik can better articulate...   ...helpful as always...
    • That said, it might be living somewhat dangerously to blindly rename existing *.BAT files to *.CMD, due to differences in ERRORLEVEL handling between the two extensions. See https://ss64.com/nt/errorlevel.html . For new scripts intended only for recent Windows versions, yes, using .CMD is a good idea.
    • And even if you think someone is an idiot, that doesn't mean they can't tell the truth. But I suppose people like BadBot don't care, it wouldn't be the first time he acted like that.
    • Because it was generated with AI (which you have to disclose), it means that you cannot copyright it (only humans get copyright). Which anyone who wants to can just steal your work for whatever reason they want, even selling the same thing on the same site, in China, etc. In short, the user will quickly learn why copyrights exist in the law to protect authors from having their work stolen. So, think about using this despicable pile of AI slop shop as a learning experience.
  • Recent Achievements

    • Reacting Well
      Alan- earned a badge
      Reacting Well
    • Week One Done
      IAMFLUXX earned a badge
      Week One Done
    • One Month Later
      Æhund earned a badge
      One Month Later
    • One Month Later
      CoolRaoul earned a badge
      One Month Later
    • First Post
      Kurotama earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      526
    2. 2
      ATLien_0
      276
    3. 3
      +FloatingFatMan
      216
    4. 4
      +Edouard
      206
    5. 5
      snowy owl
      140
  • Tell a friend

    Love Neowin? Tell a friend!