...

View Full Version : useless button



the_bob
01-07-2004, 09:55 PM
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>

Willy Duitt
01-08-2004, 12:07 AM
Of course the button will be useless if you don't tell it to do anything. :p


<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

Skyzyx
01-08-2004, 03:34 AM
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 (http://www.skyzyx.com/scripts/cdvoodoo.htm).

Willy Duitt
01-08-2004, 03:38 AM
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

Skyzyx
01-08-2004, 04:19 AM
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 (http://www.skyzyx.com/archives/000006.php) 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 (http://lists.netsys.com/pipermail/full-disclosure/2003-October/011868.html) 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. :rolleyes:

Willy Duitt
01-08-2004, 05:34 AM
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

Skyzyx
01-08-2004, 08:56 AM
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. :confused:

Willy Duitt
01-08-2004, 11:23 AM
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

the_bob
01-08-2004, 09:44 PM
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

Skyzyx
01-08-2004, 10:05 PM
You do understand that this is a security hole that has been patched, right? This is not a feature, this is a bug. :rolleyes:

the_bob
01-09-2004, 01:07 AM
bug or not, whatever. it freaks people out!:D As long as its legal i'm happy

Skyzyx
03-10-2004, 01:54 AM
Willy,

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

Hope this helps! :thumbsup:

Willy Duitt
03-10-2004, 02:14 AM
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; :thumbsup:
.....Willy



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum