Dark Bit Factory &  Gravity

Dark Bit Factory & Gravity

  • July 30, 2010 *
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Pages: [1]   Go Down

Author Topic: Help Java substitute for QB's "Shell" statement.  (Read 370 times)

0 Members and 1 Guest are viewing this topic.

relsoft

  • Senior Member
  • ******
  • Karma: 43
  • Offline Offline
  • Posts: 3180
    • View Profile
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!!!

Logged
20 LINE INTRO CHALLENGE 2ND PLACE!

Jim

  • ADMIN
  • Senior Member
  • ********
  • Karma: 325
  • Offline Offline
  • Posts: 4676
    • View Profile
Re: Help Java substitute for QB's "Shell" statement.
« Reply #1 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
Looks like
getRuntime().exec("c:/testprogram.exe");
might work.

Jim
« Last Edit: February 26, 2009 by Jim »
Logged

relsoft

  • Senior Member
  • ******
  • Karma: 43
  • Offline Offline
  • Posts: 3180
    • View Profile
Re: Help Java substitute for QB's "Shell" statement.
« Reply #2 on: February 27, 2009 »
Muchos Thank you' s!!!! :clap:
Logged
20 LINE INTRO CHALLENGE 2ND PLACE!

Pages: [1]   Go Up
 

 

B l a c k R a i n V.2 by C r i p

Page created in 0.121 seconds with 19 queries.