I have created a jar file called test.jar under C:\jars. I have JAR file under the same location named run.bat and it contains the below code -
@echo off
set exec_path=C:\jars java -cp %exec_path%/test.jar; com.mycomp.myapp.MyProgram "%1"%*
@echo on
It is running successfully from command prompt with parameters.
Now I would like to run it from another JAVA program. Please suggest.
Thanks!
cmd /c test.bat. batch files are not executable, so you execute acmdshell and tell it to run the batch file.