• 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 agree with your points, particularly around workflows. But I think this is a symptom of the way Microsoft plans, builds, and releases its OS's, not about its UI ideals itself. It has historically been large jumps in UI changes between releases, XP > Vista > 7 > 8 were ALL significant changes in how we performed tasks. Then Win10 was released and updated twice a year with minor changes. This was somewhat nice as the changes were often minimal, however as it looked like the same OS for the most part, when something did change (like the start menu), it was a bit confusing for people who didn't understand that they had actually been upgraded, and why just this one key part had changed. But I believe that was too slow, and didn't allow their future designs to be played out in that structure. So the "last Windows version ever" was superseded with a new UI and overhauled once more. It too has changed quite a bit in its 4 years, but I think there needs to be an understanding of that change, which I guess we have in the "24H2" version numbering, but not in the marketing that most users know. The most consistent and clear communication of changes I think is done with MacOS. While I'm not a fan of Apples software, their clear and consistent release schedule, and progressively planned changes to the OS is concise and clear, leading towards a well thought out goal to their users with branding the big updates, but more subtle of changes confined to those releases. Windows 10/11 version updates just get lost in the vast collection of update types in Windows Update, and as such most users wouldn't know if the were on 22H2, 23H2 or 24H2, or even know what those meant. I think we will see Microsoft drop the Win11/Win12 branding once Windows 10 has finally died. And hopefully, make it a bit more consistent with feature/UI updates sticking to an improved branded version/year release rather than "moments" or just randomly enabled elements in a random monthly update. Until then, even us tech users rarely know what features are in what release and if we will see it on our own computers. Get with it MS!
    • Hello, Horizon Data Systems, the developer, has been around for 27 years.  I do not recall hearing anything bad about them, but I also haven't used their software, either. Regards, Aryeh Goretsky  
    • Hello, I am wondering if this will go through an appeal process, or if the ruling is final? Regards, Aryeh Goretsky
    • Hello, I think it also depends upon what sorts of software you develop. My employer makes software that does rely on operating system version-specific functionality, and that is typical and normal behavior for our industry. While we do provide support for older versions of operating systems, it is only for a certain amount of time. If you still want to use our software after that, it becomes a custom support package, which isn't cheap. Regards, Aryeh Goretsky
    • Ok Mr lawyer, what violation or damage is done to requiere a regulation? I get your point but you need more valid points what and how regulations are done. Just google it. Hence me saying Mr Lawyer. I didn't learn new things just by saying big random words, I actually acknowledged and read on what they meant and work. Let's not forget there are national and there are international laws and also violations. For something to have a regulation effect, there must be some sort of damage. Sorry to tell you but annoyance isn't considered consumer damage. Apple changed to USB-C because of the EU and it caused a chain reaction to other countries but those other countries didn't change the laws. Apple saw a business change that would hit them in their production, so something that started 'national' [for simplicity sake let's say the EU is a nation] made a big splash. You might be thinking of something else and not a 'simple' regulation.
  • Recent Achievements

    • Reacting Well
      pelaird earned a badge
      Reacting Well
    • Mentor
      The Werewolf went up a rank
      Mentor
    • First Post
      Myriachan earned a badge
      First Post
    • Week One Done
      DrRonSr earned a badge
      Week One Done
    • Week One Done
      Sharon dixon earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      603
    2. 2
      ATLien_0
      214
    3. 3
      +FloatingFatMan
      169
    4. 4
      Michael Scrip
      151
    5. 5
      Som
      151
  • Tell a friend

    Love Neowin? Tell a friend!