Dark Bit Factory & Gravity

ARCHIVE => Archive => Java,JS & Flash => Topic started by: relsoft on February 26, 2009

Title: Help Java substitute for QB's "Shell" statement.
Post by: relsoft on February 26, 2009
I'm helping a friend of mine with his thesis (An OS algo simulation) and since we're out of time (Due on March) I'm making the demos in FreeBasic that could be called from Java using a "shell" subtitute.

Shell runs an EXE file and returns the control to the caller after the shelled program terminates.


Is there a way to shell in Java?

Thanks!!!

Title: Re: Help Java substitute for QB's "Shell" statement.
Post by: Jim on February 26, 2009
If you can call Windows API, then ShellExecute() will do it.

Also, java.lang.System.exec()
http://dmi.ensica.fr/doc/java/j2sdk-1_4_2-doc/docs/api/java/lang/Runtime.html (http://dmi.ensica.fr/doc/java/j2sdk-1_4_2-doc/docs/api/java/lang/Runtime.html)
Looks like
getRuntime().exec("c:/testprogram.exe");
might work.

Jim
Title: Re: Help Java substitute for QB's "Shell" statement.
Post by: relsoft on February 27, 2009
Muchos Thank you' s!!!! :clap: