I am a developer who is trying to run batch files from within a java application. As of now, i can get the batch files to run in order like so:
do { Process rt; rt=Runtime.getRuntime().exec( "run.bat "+ strUnits[iIndex]+ ".txt" + strUnits[iIndex] ) rt.wait() iIndex++; }while(strUnits[iIndex] != null )
However, I am trying to get these batch files to run at the same time (each one can run indefinately). If i remove the rt.wait(), none of the batch files get called. Is there a way to do this? Possibly with threading (dont know how to use threading if a variable number of threads are used), or is what i am trying to do out of the scope of what java can do?