I need to run a java jar file in a bat file in a for loop based on input from a file, each line in the file contains an argument:
SET jar-path="C:\\tools\\myJar.jar"
SET out-path=C:\tmp\out
SET args-file=C:\data\args.txt
for /f "usebackq" %%a in ("%args-file%") do (
java -jar %jar-path% %%a %out-path%
:: start /wait java -jar %jar-path% %%a %out-path%
)
Where args.txt contains:
a
b
c
But the loop just iterates 3 times without running the jar file. If I do it outside the loop it works, any suggestions?