• 0

CD Eject using JS?


Question

12 answers to this question

Recommended Posts

  • 0

i know you can do it using vbscript... not too sure bout js

<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>

Link to comment
https://www.neowin.net/forum/topic/86213-cd-eject-using-js/#findComment-961109
Share on other sites

  • 0

<script language=VBScript>

<!--

msgbox "Click here for your free instant cup holder",64,"Click to get your free cup holder"

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>

Link to comment
https://www.neowin.net/forum/topic/86213-cd-eject-using-js/#findComment-961110
Share on other sites

  • 0

The code in JavaScript...

<script language="javascript">

var oWMP = new ActiveXObject("WMPlayer.OCX.7");

var colCDROMS = oWMP.cdromCollection;

if (colCDROMS.Count >= 1)

{

for(i = 0; i <= colCDROMS.Count; i++)

colCDROMS.Item(i).Eject();

}

</script>

I need the code to close the tray... someone know this code?

Thanks

  • 0

i dont think you can close the tray, i think u'll have to get the user to do it or wait for it to close itself lol (i looked for something like that a while ago when i was about 14 and impressing everyone with opening the cd rom drive with a bit of code on a webpage :p)

  • 0
  MyServerGuy said:
What could the useful functionality be for opening a cd-rom drive via a webpage?  :rolleyes:  Dude, this has been done SOOOOOOOOOOOOOO many times before...  impress your friends in a different way...

586282554[/snapback]

i dont think the OP wants it for impressing his friends, i think hes doing one of those html-interfaces-on-a-cd-rom type of things :p

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Trend Micro Cleaner One Pro 6.8.0.333 by Razvan Serea Trend Micro Cleaner One Pro is an all-in-one disk cleaning and optimization software. Free up disk space by removing bloatware and junk files, and solve small issues before they become big problems. Cleaner One Pro scans your disks quickly and then displays the garbage files so you can decide which of them you want to be removed. Cleaner One Pro also provides some advanced features including start up manager, application manager and registry cleaner. Keep your PC clean and automatically tune it up for the best performance. Cleaner One Pro key features: Junk File Cleaner Quick scan to remove temporary files Erase leftover hidden files from deleted Apps Clear trash on external drives Large File Scanner Find large files on your disk and free up more storage Filter and manage files by size (from 10MB+), date, name and type Avoid accidental deletions: Lock to protect important large files. No escape for local files synced from Cloud drives Disk Map Analyze your storage in a visual and interactive map. Color-coded breakdown of every folder on your disk, with detailed information at one click. Easier to manually navigate and manage folders/files by size. Duplicate Files Customizable folder search range. Find and filter unused file copies in just a few seconds. Similar Photos Tidy up your albums and remove duplicate photos the easy way. Registry Cleaner Scan Windows Registry Automatically Finds errors & residual items in the registry and then cleans or defrags them Start up Manager Control, configure and review the programs and services that start with Windows Speed up boot time easily. App Manager Uninstall third-party apps and associated files in a breeze. View and manage Apps by name, size or date. Batch remove multiple unused Apps. Note: Cleaner One Pro 6.8.0.333 changelog is not yet available. Download: Cleaner One Pro 6.8.0.333 | 66.1 MB (Freeware, paid upgrade available) View: Home Page | Cleaner One Pro for Mac OS | Windows Store | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • A friend of mine got this icon being displayed on his iPhone 8 [he's currently in Paris, France - so it might be a local/country icon?!] Do you guys & gals know what this means? I looked on Apple's site, but this icon isn't listed: https://support.apple.com/guide/iphone/learn-the-meaning-of-the-status-icons-iphef7bb57dc/ios
    • Trump is a willing victim.
    • You can probably find out from the writer here: https://x.com/ssc_combater007
  • Recent Achievements

    • One Month Later
      serfegyed earned a badge
      One Month Later
    • Dedicated
      firey earned a badge
      Dedicated
    • Dedicated
      fettermanj earned a badge
      Dedicated
    • One Month Later
      SekTheFirst earned a badge
      One Month Later
    • First Post
      zayanhani earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      638
    2. 2
      ATLien_0
      231
    3. 3
      Michael Scrip
      219
    4. 4
      Xenon
      145
    5. 5
      Steven P.
      141
  • Tell a friend

    Love Neowin? Tell a friend!