Reputation: 2451
I have following command line batch file
REM test
call java -server -Xms2048m -Xmx4096m -XX:MaxPermSize=512m -Dlog4j.configuration=file:///C:/codex/props/log4j.xml -Dlog4j.output.dir=C:/logs//codex-logs -jar codex-1.0.jar
Question is that is there anyway file can be maintain format having carriage return lines?
something like following for better reading and maintainability???
REM test
call java -server -Xms2048m -Xmx4096m -XX:MaxPermSize=512m
-Dlog4j.configuration=file:///C:/codex/props/log4j.xml
-Dlog4j.output.dir=C:/logs//codex-logs
-jar codex-1.0.jar
Upvotes: 2
Views: 973
Reputation: 22392
I think Jiri Kremser's answer is correct but if your goal is "better reading and maintainability" , you can use variables too:
REM test
set var1=java -server -Xms2048m -Xmx4096m -XX:MaxPermSize=512m
set var2=-Dlog4j.configuration=file:///C:/codex/props/log4j.xml
set var3=-Dlog4j.output.dir=C:/logs//codex-logs
set var4=-jar codex-1.0.jar
echo %var1% %var2% %var3% %var4%
call %var1% %var2% %var3% %var4%
Upvotes: 2
Reputation: 635
I believe adding simply the backslash '\' at the end of each line will allow you make it behave like one line. Since it escapes the newline character.
Upvotes: -1
Reputation: 12847
Use the character ^
for it
REM test
call java -server -Xms2048m -Xmx4096m -XX:MaxPermSize=512m^
-Dlog4j.configuration=file:///C:/codex/props/log4j.xml^
-Dlog4j.output.dir=C:/logs//codex-logs^
-jar codex-1.0.jar
Upvotes: 1