running .exe application from java file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nike111
    New Member
    • Jun 2009
    • 15

    running .exe application from java file

    hi,
    I wanna run a few files which are .exe and .jar from a java file as a part of my application...
    This is the code that i got frm net
    /* Runtime rt = Runtime.getRunt ime() ;
    Process p = rt.exec("notepa d") ; */

    i am not able to open other files but its possible by giving their path....... I need to run my application on different systems, i cannot change the path everytime as per the system.....

    so please can anyone say me what is the correct code
    Thanks in advance
    NIKHILESH
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    The process should automatically take into account the path environment variable.

    What program are you trying to run? If notepad, it should almost always be on the path, (unless someone has custom changed it). If it is your own program, then the installation package for your program should add its corresponding installation directory to the path variable.

    Comment

    Working...