Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open CD ROM Drive

Status
Not open for further replies.

lagerplease

Technical User
Dec 15, 2001
38
GB
In the past I've seen little snippets of code that open the CD ROM drive on a user's machine. Is it possible to do this from a browser using PERL (or Javascript or anything else, really!)?
 
This is supposed to work if you have Windows Media Player installed:

<a href="#" onClick="openCDs()">Open CDs</a>

<script language="VBScript">
<!--
Function openCDs
Set mediaPlayer = CreateObject("WMPlayer.OCX.7" )
If mediaPlayer.cdromCollection.count >= 1 then
For i = 0 To mediaPlayer.cdromCollection.count - 1
Call mediaPlayer.cdromCollection.item(i).eject()
Next
End If
End Function
-->
</script>


and this is supposed to work in Netscape 7.1:

<script type="text/javascript">
function opencd()
{
var oWMP = new GeckoActiveXObject('WMPlayer.OCX.7');
if(oWMP.settings.mediaAccessRights != 'none' || oWMP.settings.requestMediaAccessRights('read'))
{
var colCDROMs = oWMP.cdromCollection;
for(var i = 0; i < colCDROMs.count; i++)
colCDROMs.item(i).eject();
}
oWMP.close();
}
</script>


I haven't tried any of the scripts above...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top