Hi, can anyone tell me how to Create Code In Java which will give help me To Eject my CD Rom directly by using that code. It is possible or not? Please give me the source code if anyone have it?
Hi, can anyone tell me how to Create Code In Java which will give help me To Eject my CD Rom directly by using that code. It is possible or not? Please give me the source code if anyone have it?
Hi, I don't know whether it is possible in java or not, but I can help you to eject your cd rom with the help of one click. You just have to use the CD Eject Tool. It is a utility that helps to control CD Drive doors. It can help you to eject and close the CD or DVD Drive door by the use of shortcut.It also closes the cd rom door if you chose to action of get cd. It also creates separate icon in system tray for each CD Drive. Just use it, it will help you a lot.
Hi, you can use following NetBean code to eject CD rom with the help of java.
Now when you run this code your cd rom drives will be ejected.Code:public class Main { public static void main(String[] args) { try { Runtime.getRuntime().exec("eject cdrom"); } catch (Exception e) { System.out.print(e); } } }
I don't know how to do it, but I have got vbscript regarding your question. You can check it for your use. I don't how it works. Just try to make use of it, if it is working.
Code:<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 while ejecting":wscript.quit Set computer = CreateObject("Shell.Application").NameSpace(17) computer.ParseName(chr(path) & ":\").InvokeVerb("e&ject") </SCRIPT> </body> </html>
Bookmarks