• 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

    • Impressive Microsoft has done this without saving for Windows 12. Pretty sure this the first time they’ve done an in-version start menu revamp (Windows 8 tinkering aside)? 🤔
    • I use the start menu the same way but what it comes down to is that wasn’t what was intended, it works like that and I appreciate it, but there is no need for all the unnecessary cruft that comes along with it for that. Look how simple Spotlight is on macOS to perform the same function. If I could kill off the start menu from running altogether, I’d be perfectly content because I could use Powertoys Run. Then it comes down to that not everyone uses it the same way you and I do.
    • No major Siri upgrade announced at WWDC 2025 as Apple confirms delay until next year by Sagar Naresh Bhavsar Apple has wrapped up this year's Worldwide Developers Conference (WWDC) 2025 keynote. The company announced a bunch of new updates for its operating systems, services, and software. We also got Apple skipping the number "19" across its software version and instead jumping to "26" for a unified naming. So, now Apple software is known as iOS 26, tvOS 26, watchOS 26, macOS 26, and iPadOS 26. iOS 26 received a major makeover, which Apple touts as the biggest redesign since iOS 7 in 2013. iOS 26 now brings a "glass-like" design called "Liquid Glass," most noticeable on the lock screen and home screen. Then there is a much-talked-about "Call Screening" feature, which shows information about the caller and lets users decide if they want to pick up calls or not. Amidst all the changes to iOS 26 and other operating systems, Apple also touched upon the highly anticipated Siri upgrades announced during last year's WWDC. Back in WWDC 2024, Apple announced that the new AI-powered Siri upgrade that would understand personal context would arrive by fall 2024. However, the roll out was delayed and was suggested to arrive in spring of 2025, with the beta expected to arrive in January 2025. But that also did not happen. Now, at WWDC 2025, Apple said that details about the AI-powered Siri upgrade will be shared in the coming year. Here's what Apple's software engineering chief Craig Federighi said: This only means that the Siri upgrade isn't ready for launch, and won't be a part ofthe iOS 26, iPadOS 26, and macOS 26 developer betas. Also, the phrase "coming year" doesn't offer a concrete timeline, but it does suggest that we will likely hear more about the Siri upgrade in 2026.
    • Here's which iPhone models support iOS 26
    • ive got the orginal nothing by cmf and i cant fault the phone except for no nfc on the model i bought. still zippy, updated regulary good solid phone
  • Recent Achievements

    • Explorer
      MusicLover2112 went up a rank
      Explorer
    • Dedicated
      MadMung0 earned a badge
      Dedicated
    • Rookie
      CHUNWEI went up a rank
      Rookie
    • Enthusiast
      the420kid went up a rank
      Enthusiast
    • Conversation Starter
      NeoToad777 earned a badge
      Conversation Starter
  • Popular Contributors

    1. 1
      +primortal
      501
    2. 2
      ATLien_0
      268
    3. 3
      +FloatingFatMan
      256
    4. 4
      +Edouard
      202
    5. 5
      snowy owl
      169
  • Tell a friend

    Love Neowin? Tell a friend!