Click to See Complete Forum and Search --> : Opening and closing CD rom drives
Vasilli
07-01-2003, 05:27 AM
Does anyone know how to close a cd rom drive using Javascript or VB, i have a script that will open them, however i need one that will close them if they are open
can someone help!!
Thankyou in advance
Vasilli
VB script to open CD drives
' VB Script
<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>
Khalid Ali
07-01-2003, 08:47 AM
though I am just guessing ,with MS my guesses have usually been correct..
try this
colCDROMs.Item(i).Close
nkaisare
07-01-2003, 10:57 AM
Why would you want to open/close my CD ROM drive? Leave that to my choice.
colCDROMs.Item(i).Close
If "close" doesn't work, wouldn't applying eject again to an open CD ROM close it?
BTW, Remind me to browse your site with javascript turned off.
;) AJ
Originally posted by nkaisare
BTW, Remind me to browse your site with javascript turned off.Remind me not to browse his site at all... :D
Lol... I was wondering what AJ stood for, then I found this a different thread:
Originally posted by nkaisare
- Anti-Javaite (AJ):p
diamonds
07-01-2003, 03:26 PM
remember you can only do as much as the program the next level up. If windows OS only allows you to open it (being true) than in JS you can only open it.
anyway, I didn't know JS even HAD the permissions to open a users CD ROM drive...
Khalid Ali
07-01-2003, 03:33 PM
Originally posted by diamonds
r I didn't know JS even HAD the permissions to open a users CD ROM drive...
JavaScript still does not do this ,he is using MS specific VBScript.
Vasilli
07-01-2003, 05:53 PM
Ok thank you all for the advice.
Yes I would prefer NOT to have this script open my CDRom drives if I visited a page either, but it is true that YOU DO WHAT THE CLIENT WANTS, THEN COMPLAIN ABOUT IT LATER!!.
hehe well thank you all for your help!! even though I have convinced them to just make the lazy buggers visiting the site open their own CD drives :P
Thanks again
Jono