some complex java help

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

  1. Game_Tester_1993


    Apr 23, 2011
    Likes Received:
    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) {
        }catch (Exception err) {
    Code (Text):

    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(
     String line;
     while ((line = reader.readLine()) != null) {
      if (line.contains(serviceName)) {
       return true;
     return false;
    any help in this would be greatly appreciated
    Game_Tester_1993, Apr 23, 2011
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.