I’m trying to run a .bat file in java, but I’m using the specific path(C:..). I was hoping to make it run a bat file inside my src folder in java. How should I code it? this is my current code:
run.exec("cmd start /c C:\Users\mico\workspace\ANTLR java\src\jython2.5.2");
and I also want to put the source file(the path to where the file is saved)
this is the cmd command I’m using:
C:\Users\mico\workspace\ANTLR java\src\jython2.5.2\jython C:\Users\mico\workspace\ANTLR java\src\save.py
How do I execute the entire command while not making it a static path and be able to load the file?
You can define the file’s path in Autoexec.bat file by appending path line or follow this steps.