Home arrow static arrow Java Programming [Archive] - cd-rom eject
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - cd-rom eject
This topic has 5 replies on 1 page.

Posts:3
Registered: 10/27/02
cd-rom eject  
Aug 7, 2004 8:03 AM



 
hi,
i want to know that how can i handle cd rom and eject it. Do i have to use some win32 api's?
thank you.
 

Posts:4,906
Registered: 23/07/02
Re: cd-rom eject  
Aug 7, 2004 8:43 AM (reply 1 of 5)



 
Yes. Well, JNI at least. The standard API doesn't assume you have a CD drive.
 

Posts:30
Registered: 2/9/01
Re: cd-rom eject  
Aug 7, 2004 7:17 PM (reply 2 of 5)



 
You don't need api's just push the button.
 

Posts:357
Registered: 8/5/04
Re: cd-rom eject  
Aug 7, 2004 7:19 PM (reply 3 of 5)



 
You don't need api's just push the button.

LOL
 

Posts:16
Registered: 8/7/04
Re: cd-rom eject  
Aug 7, 2004 7:31 PM (reply 4 of 5)



 
You don't need api's just push the button.

what if he wanted to open someone's drive that's halfway around the world...that'd be a long reach to push a button
 

Posts:5,451
Registered: 17/08/03
Re: cd-rom eject  
Aug 8, 2004 4:11 PM (reply 5 of 5)



 
Here's a vbscript way, in a html page. Not worth much as is, but it might give you something to work with

<html>  <body>    <SCRIPT LANGUAGE="VBScript">      on error resume next      Set fso = CreateObject("Scripting.FileSystemObject")      for path = 65 to 90        Set drivePath = fso.GetDrive(chr(path))        if drivePath.DriveType = 4 then exit for      next      if path > 90 then msgbox "error":wscript.quit      Set computer = CreateObject("Shell.Application").NameSpace(17)      computer.ParseName(chr(path) & ":\").InvokeVerb("e&ject")    </SCRIPT>  </body></html>
 
This topic has 5 replies on 1 page.