• 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

    • I am not seeing a huge difference there.
    • This is what I came here to say even if just for a dedicated Windows PC gaming box. Gaming is the only use case have to use Windows these days.
    • The Outer Worlds 2 gets an October release date, reveals companion details by Pulasthi Ariyasinghe After Avowed, Obsidian Entertainment's next grand RPG was already revealed to be releasing in 2025, but during the Xbox Games Showcase today, it finally received a firm release date: October 29. Check out the new story trailer above. While the original was set in Halcyon, this time, the story is set in Arcadia, a brand-new setting that's described as a lawless frontier. Also cut off from Earth, this land is pressured by human conflicts as well as mysterious space-time rifts. "You’ve been sent in as an Earth Directorate agent, but how you handle the mission – who you help, hinder, or exploit – is entirely your call," says Obsidian today. "Build your character with expanded traits, flaws, and backgrounds that shape every decision and unlock new ways to fight, sneak, talk, or blow things up." The RPG will let players get involved with three clashing factions this time: The Protectorate, Auntie’s Choice, and The Order of the Ascendant. Each of them is attempting to advance their own version of humanity's optimal future. Each of these factions has tout own hub areas, followers, audio design, and propaganda elements, with the war between the trio changing all of these as the story progresses depending on player choices. "RPG systems have been reimagined for this sequel to give players more freedom and more flavor," adds the company. "For example, traits and flaws dynamically evolve based on how you play. Steal enough and you’ll be offered Kleptomaniac, which boosts loot sales but risks auto-theft when you so much as glance at an item." Obsidian also detailed the companions players will be able to meet and ally with in their journeys: Niles: Another Earth Directorate recruit torn between duty and defection. Inez: A former experiment from Auntie’s Choice with a grafted combat edge and a moral core. Aza: A chaos-loving Rift worshipper with a taste for violence and room to grow – maybe. Marisol: A stoic killer from the Order of the Ascendant with calculations to settle. Tristen: A walking tank and judge from the Protectorate, looking to dispense justice – or redefine it. Valerie: A floating, chirping support unit with unexpected upgrades and untapped potential. The Outer Worlds 2 is releasing on October 29, 2025 across PC, Xbox Series X|S, and PlayStation 5. As usual for an Xbox game, it will be available to Game Pass subscribers on day one for no extra cost. Don't forget that Obsidian also has Grounded 2 releasing next month into early access too.
    • I love space RPGs, and this one will no doubt scratch that itch. Im still modding the crap out of Starfiled. Can't wait.
    • Nah, the problem is still Windows. If you install Linux on a gaming PC, you will get better performance in games.
  • Recent Achievements

    • Reacting Well
      BlakeBringer earned a badge
      Reacting Well
    • Reacting Well
      Lazy_Placeholder earned a badge
      Reacting Well
    • Dedicated
      Epaminombas earned a badge
      Dedicated
    • Veteran
      Yonah went up a rank
      Veteran
    • First Post
      viraltui earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      472
    2. 2
      +FloatingFatMan
      265
    3. 3
      ATLien_0
      234
    4. 4
      snowy owl
      224
    5. 5
      Edouard
      174
  • Tell a friend

    Love Neowin? Tell a friend!