Given this file myfile.txt
:
-Dvariable=a -Dvariable2=b -Dvariable3=c
-Dvariable=a -Dvariable2=b -Dvariable3=d
-Dvariable=a -Dvariable2=b -Dvariable3=e
and batch.bat
:
for /F "tokens=*" %%A in (myfile.txt) do (
C:\javapath\java.exe %%A -XX:..... -classpath....... main.Main
)
How can I make %%A
dereference as program arguments?
With the above, the output is: (i.e. its just stopping after java.exe)
(C:\javapath\java.exe)
Usage: java [-options] class [args...] //etc....
With doing set first, I simply get spaces:
batch.bat:
set x=%%A
C:\javapath\java.exe %x% -XX:..... -classpath....... main.Main
output:
set x=-Dvariable=a -Dvariable2=b -Dvariable3=c
C:\javapath\java.exe -XX:..... -classpath....... main.Main