Modify the program to take three arguments instead of two. Then use the second and third arguments to form a loop.
Originally your program maybe like:
public static void main(String[] args) {
String arg1 = args[0];
String arg2 = args[1];
//process using arg1 and arg2
}
Change it to the following:
public static void main(String[] args) {
String arg1 = args[0];
String arg2 = args[1];
String arg3 = args[2];
int loopstart = Integer.parseInt(arg2);
int loopend = Integer.parseInt(arg3);
for (int i = loopstart; i <= loopend; i++) {
//process using arg1 and i <-- take note
}
}
Note: Repeatedly calling the program from a loop in a batch file is much slower, and less desirable than actually using a loop within the program itself.