some complex java help

Discussion in 'Java' started by Game_Tester_1993, Apr 23, 2011.

  1. Game_Tester_1993

    Game_Tester_1993

    Joined:
    Apr 23, 2011
    Messages:
    1
    Likes Received:
    0
    hi im not sure if anyone on this site can help me, im realtively new, and only just getting back into java and realising how hard it is to work with at times without and proper guides easily found.

    What im trying to do is create a Java program that will Execute AHK Executable files let them run and then continue with it self. now i have found and been given many references and code to use but none it makes sense because of lacking explanation on what to do with the code exactly etc

    what i want to do is this.

    Code (Text):

    start/run/execute(whatever u want to call it) a file
    wait for that file to close
    continue on with script
    rinse repeat
     
    examples to do this i have been given are :

    Code (Text):
    Runtime.getRuntime().exec(<Name of file>).wait();
    Code (Text):
    try {
                     String line;
                     Process Login = Runtime.getRuntime().exec(command);
          BufferedReader input =new BufferedReader(new InputStreamReader(Login.getInputStream()));
          while ((line = input.readLine()) != null) {
            System.out.println(line);
          }
          input.close();
        }catch (Exception err) {
          err.printStackTrace();
        }
    Code (Text):
    Runtime.getRuntime().exec()

    private static final String TASKLIST = "tasklist";
     
    public static boolean isProcessRunging(String serviceName) throws Exception {
     
     Process p = Runtime.getRuntime().exec(TASKLIST);
     BufferedReader reader = new BufferedReader(new InputStreamReader(
       p.getInputStream()));
     String line;
     while ((line = reader.readLine()) != null) {
     
      System.out.println(line);
      if (line.contains(serviceName)) {
       return true;
      }
     }
     
     return false;
     
    }
    any help in this would be greatly appreciated
     
    Game_Tester_1993, Apr 23, 2011
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    0
    Views:
    831
    Guest
    Feb 25, 2004
  2. news.amnet.net.au
    Replies:
    1
    Views:
    818
    =?UTF-8?b?TMSByrtpZSBUZWNoaWU=?=
    Apr 13, 2004
  3. Gabe
    Replies:
    3
    Views:
    1,389
  4. yuyazhang
    Replies:
    14
    Views:
    980
    yuyazhang
    Apr 29, 2006
  5. Stanimir Stamenkov
    Replies:
    2
    Views:
    1,016
    Stanimir Stamenkov
    Oct 25, 2005
  6. Robert Mark Bram
    Replies:
    0
    Views:
    856
    Robert Mark Bram
    Feb 4, 2007
  7. Domino
    Replies:
    5
    Views:
    725
    dorayme
    Nov 5, 2006
  8. Kottiyath

    How complex is complex?

    Kottiyath, Mar 18, 2009, in forum: Python
    Replies:
    22
    Views:
    1,068
    james@biosci.utexas.edu
    Mar 28, 2009
Loading...