Results 1 to 2 of 2
  1. #1
    ankitmcgill is offline Member
    Join Date
    Nov 2008
    Posts
    22
    Rep Power
    0

    Default Execute external program from java

    Hi all,

    got another question for you guys ...

    i want to run an external executable from my java program at the click of a button and then resize and reposition the external programs window to user defined cordinates.

    example : program :c:\users\ankit\notepad.exe
    width : 200px
    height : 400px
    x,y : 100,100

    how would i do this ? any help is appreciated.

    thanks / ankit

  2. #2
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    positioning I have no idea. Most likely it is not possible, as it is not part of the Java program. As for running an executable. Runtime.getRuntime().exec("MyExecutable.exe")

    For command line programs and retrieving program exit codes, see this lengthy thread

    Some simple commands for windows and possibly other OS's that may work for you:

    cmd start MyApp.exe
    cmd /c start MyApp.exe
    Last edited by Singing Boyo; 06-01-2009 at 05:00 AM.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

Similar Threads

  1. Execute external file/program
    By sirwiggles in forum New To Java
    Replies: 3
    Last Post: 04-22-2009, 12:35 AM
  2. How to execute external EXE?
    By 2bGeek in forum AWT / Swing
    Replies: 3
    Last Post: 02-21-2009, 01:59 AM
  3. Replies: 0
    Last Post: 04-04-2008, 03:40 PM
  4. Using Runtime to execute external commands
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-05-2008, 10:14 AM
  5. Replies: 0
    Last Post: 10-04-2007, 10:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •