Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13

Thread: useless button

  1. #1
    New Coder
    Join Date
    Dec 2003
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    useless button

    Ok, I got a code from a different thread here to open a cd drive and it works great, but I tried to add a button to it and add some alert messages but it doesn't work. It just opens the drive when the page loads and the button does nothing.

    <script type="text/javascript">

    alert("Step one, put in cd");
    alert("Here, I'll help you out")

    //<![CDATA[
    var oWMP = new ActiveXObject("WMPlayer.OCX.7"), colCDROMs = oWMP.cdromCollection;
    if(colCDROMs.Count >= 1) for(i=0; i<colCDROMs.Count; i++) colCDROMs.item(i).eject();
    //]]>

    alert("Now put in the cd.");
    alert("Now close cd drive.")

    </script>

    <form>

    <input type="button" name="Background Music">

    </form>

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Of course the button will be useless if you don't tell it to do anything.

    Code:
    <script type="text/javascript">
    function openTray() {
    alert("Step one, put in cd");
    alert("Here, I'll help you out")
    
    //<![CDATA[
    var oWMP = new ActiveXObject("WMPlayer.OCX.7"), colCDROMs = oWMP.cdromCollection;
    if(colCDROMs.Count >= 1) for(i=0; i<colCDROMs.Count; i++) colCDROMs.item(i).eject();
    //]]>
    
    alert("Now put in the cd.");
    alert("Now close cd drive.")
    }
    </script>
    </HEAD>
    
    <BODY>
    <form>
    <input type="button" name="Background Music" value="Open CD Tray(s)" onclick="openTray()">
    </form>
    Additionally, there are several fundemental flaws with your approach to do this for the user.
    • Firstly, this code will open all of the users CD Trays.

      Secondly, If there are several CD Trays, you will not know which
      is the one the user uses for playback, which is the Writable CD,
      or even a DVD whether writable or not.


    Your attempt to be cute and open the tray for a user may just backfire and prove to be irritating.

    .....Willy

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also, this was listed as a security flaw in Internet Explorer and has since been patched. People (like me) who regularly visit the WindowsUpdate website to get the latest bug fixes won't have their CD drives opened. It also doesn't work on anything other than IE/Win (and there are more browsers and platforms out there than just Internet Explorer and Windows ).

    I know this, because I posted this same code I found last June on my website as an "Evil Script" called CD Voodoo.

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Skyzyx;

    I recently read that there was a patch but have not been able to
    find the exact Article/Download and the update scan does not list
    nor indicate that I need the patch. But, my trays still open.

    Do you have a link handy?

    Thanks;
    .....Willy

  • #5
    Regular Coder
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I found the script in late May or early June, and it worked. The "View installation history" on Windows Update says that I had downloaded every single patch available May 16th. I did another "download everything" on June 30th. On July 3, I posted that the patch was released because it didn't work on my system anymore.

    I'd say it was patched between May 16th and June 30th, 2003. I know that Microsoft's website is absolutely horrible to try and search through, but this link describes that it was an exploit where a malicious user could run unauthorized code on your computer... blah, blah, blah. Same as every other IE security hole.

  • #6
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Skyzyx;

    Thanks for your time. I once again looked but couldn't find anything. Plus, it has now occured to be that I did download the MediaPlayer9 update but it messed up my Media Library and I didn't feel like reentering everything so I restored my system back prior to taking the update. Now it tells me I do not have MediaPlayer9 and it won't let me take the update. Only thing is, it came bundled with my machine. That may be my problem?

    .....Willy

  • #7
    Regular Coder
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well the script utilizes a flaw in WMP 7-9 that is accessed by a security hole in Internet Explorer... but this is a WMP flaw. Windows XP came with WMP8. I think WinMe came with 6.4, and Win 2000 is even older than that.

    I think that if you're running anything earlier than XP and you did a system restore, Microsoft may not have fixed the exploit for you. On the other hand, WMP 6.4 uses a different CLSID and ActiveX object, so this script shouldn't even work for you anyways.

    Hmmm... that's wierd.

  • #8
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's a new system running XP.
    It may have originally had WMP-8 installed.
    I guess I'll try to download WMP-9 again....

    Thanks again;
    .....Willy

  • #9
    New Coder
    Join Date
    Dec 2003
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well, thanx for the code, and second, yes i know there are other browsers but all my friends got IE so i don't really care

  • #10
    Regular Coder
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You do understand that this is a security hole that has been patched, right? This is not a feature, this is a bug.

  • #11
    New Coder
    Join Date
    Dec 2003
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    bug or not, whatever. it freaks people out! As long as its legal i'm happy

  • #12
    Regular Coder
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Willy,

    I know this was months ago, but I found the link:
    http://support.microsoft.com/default...b;en-us;819639

    Hope this helps!

  • #13
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Skyzyx;

    I tried downloading and installing the patch again but my CD trays still open. And, I have since lost my Media Library anyway.

    I'm getting ready to install another HD and hopefully a clean install will fix this and several other problems I am having.

    Appreciate you looking out tho;
    .....Willy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •