• 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

    • Yup, a bit slow on some PCs at the time, but absolutely gorgeous.
    • That's essentially what I've been running on KDE
    • For some of us, we've never left! A lot of customization tools have allowed us to adopt a non-native glassy design.
    • iPadOS 26 is now official with improved windowing, menu bar, 'Liquid Glass' redesign, more by Taras Buria As expected, today, at WWDC 2025, Apple announced iOS 26 and other operating systems that now carry the 26 version number (for simplicity). iPadOS is also part of the big redesign, and it is now official with the new Liquid Glass design, improved window controls, a Mac-like menu bar, file management enhancements, and more. In addition to the general Liquid Glass redesign, which is now present across all of Apple's operating systems, iPadOS 26 received several iPad-exclusive upgrades. It now has a reworked windowing system that helps you organize and switch between apps. You can finally place and resize apps exactly how you want. Plus, iPadOS now has familiar window controls: three buttons for closing, minimizing, and resizing your app. Straight from macOS. Apps can now remember their previous size and position, and Expose can show you all open windows. Finally, iPadOS now has a menu bar, which is another thing that comes from macOS. It gives access to common actions, commands, and features. Developers can customize the menu bar in their apps and specify what features are available there. Apple is also upgrading the Files app with a reworked List view, which now shows more details about your files and the ability to expand or collapse folders. Plus, you can customize folders with colors and emojis, pin folders to the dock, and set default apps for file types. When working with long-running processes, background tasks show up as live activities, so that you can track Final Cut exports or the Files app moving stuff around. Other changes in iPadOS 26 include improved audio controls and the ability to select audio input source and record audio with voice isolation. The Journal app is now available on the iPad, Notes received markdown support, and Calculator now supports 3D graphing capabilities. You can learn more about iPadOS 26 in the official announcement post here.
    • That same Brave that tried to insert their own ads instead of blocked ones?
  • Recent Achievements

    • Rookie
      CHUNWEI went up a rank
      Rookie
    • Enthusiast
      the420kid went up a rank
      Enthusiast
    • Conversation Starter
      NeoToad777 earned a badge
      Conversation Starter
    • Week One Done
      VicByrd earned a badge
      Week One Done
    • Reacting Well
      NeoToad777 earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      476
    2. 2
      +FloatingFatMan
      279
    3. 3
      ATLien_0
      255
    4. 4
      Edouard
      204
    5. 5
      snowy owl
      200
  • Tell a friend

    Love Neowin? Tell a friend!