ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DoNOTuseREPLY" <DoNOTuseRE...@BusinessOmaha.com>
Subject Re: Exec in a new process
Date Fri, 14 Feb 2003 15:38:27 GMT
"Dominique Devienne" <DDevienne@lgc.com>
Sent: Tuesday, January 21, 2003 10:14 AM
Subject: RE: Exec in a new process

>If anyone knows of a way to start a background process from Ant in Windoze
in a windoze-independent manner

Though not "pure" ANT!  This might work for you if I understood the issue -
it does work for us.  At the end there are some of the generally existing
winX that I diddled with that worked for examples.  Just replace the String
cmd[] elements with your own or one of the selections that are provided.

jimS (info@kjs-a.com)

// usage:  java execPlay02
import java.io.IOException;
public class ExecPlay02{
   public static void main(String zot[]) throws
IOException,InterruptedException{
      Runtime rT=Runtime.getRuntime();
      Process pC=null;
      String cmd[]={
         "notepad",
         "ExecPlay02.java"
         };

         pC=rT.exec(cmd);
         pC.waitFor();     // comment to return to prompt before done

      } // end method main
} // end class ExecPlay02

// using . (dot) separating the folder/directories seemed to cause the
// path to the current working directory to be appended to the path inside
// the quotes

// using .. (dot dot) seems to allow accessing a graphic when using paint
that is
// located in the parent directory

// .exe located in c:\windows seem to be executed without a path

/*
         "notepad",
         "a:/execPlay/execPlay02.txt"
*/
/*
         "winmine"
*/
/*
         "mshearts" or "sol" or "freecell" or "winmine"
*/
/*
         "pbrush",
*/
/*
         "pbrush",   // an alternative "c:/program
files/accessories/mspaint"
         "a:/ep/xxx.gif"
*/
/*
         "dialer"
*/



Mime
View raw message