/    Sign up×
Community /Pin to ProfileBookmark

Opening and closing CD rom drives

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>

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliJul 01.2003 — though I am just guessing ,with MS my guesses have usually been correct..

try this

colCDROMs.Item(i).Close
Copy linkTweet thisAlerts:
@nkaisareJul 01.2003 — Why would you want to open/close my CD ROM drive? Leave that to my choice.

[b]colCDROMs.Item(i).Close[/b]

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
Copy linkTweet thisAlerts:
@pyroJul 01.2003 — [i]Originally posted by nkaisare [/i]

[B]BTW, Remind me to browse your site with javascript turned off.[/B][/QUOTE]
Remind me not to browse his site at all... ?
Copy linkTweet thisAlerts:
@pyroJul 01.2003 — Lol... I was wondering what AJ stood for, then I found this a different thread:

[i]Originally posted by nkaisare[/i]

[b]- Anti-Javaite (AJ)[/b][/quote]
:p
Copy linkTweet thisAlerts:
@diamondsJul 01.2003 — 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...
Copy linkTweet thisAlerts:
@Khalid_AliJul 01.2003 — [i]Originally posted by diamonds [/i]

[B]r I didn't know JS even HAD the permissions to open a users CD ROM drive... [/B][/QUOTE]

JavaScript still does not do this ,he is using MS specific VBScript.
Copy linkTweet thisAlerts:
@VasilliauthorJul 01.2003 — 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 ?

Thanks again

Jono
×

Success!

Help @Vasilli spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...