1 command on multiple lines in a .bat file
Solved
elouise
Posted messages
5
Registration date
Status
Membre
-
Jacquo -
Jacquo -
Hello,
I just realized that I have already posted this message as a reply, I apologize, it's my first time participating in an internet forum.
My question is the following:
Can we write a command over several lines in a batch file? I have Java commands with several options that make the command line too long, can I split it? If so, how?
Thank you.
I just realized that I have already posted this message as a reply, I apologize, it's my first time participating in an internet forum.
My question is the following:
Can we write a command over several lines in a batch file? I have Java commands with several options that make the command line too long, can I split it? If so, how?
Thank you.
Configuration: Windows XP Firefox 2.0.0.9
5 réponses
Hello,
I would like to thank you again.
The solution is finally as follows:
instead of using \ to break the line like in UNIX, we use ^ under Windows.
Thank you, so issue resolved.
I would like to thank you again.
The solution is finally as follows:
instead of using \ to break the line like in UNIX, we use ^ under Windows.
Thank you, so issue resolved.
Jacquo
Thank you for the solution.
Hello,
Thank you for getting back to me.
Here’s what I tried to do:
here is my command in the script.bat file:
java -cp .;..\..\Javasys -Dtlcif.ram.target=tlcif.ram.jvm.Jram -Dtlcif.ram.symtab=none -Dtlcif.ram.code=elevcct.JramApp elevcct.DemoGUI
it’s on a single line, with what you suggested it becomes:
java -cp .;..\..\Javasys -Dtlcif.ram.target=tlcif.ram.jvm.Jram line_break
-Dtlcif.ram.symtab=none -Dtlcif.ram.code=elevcct.JramApp elevcct.DemoGUI
with line_break = xxx \ or aa \ or \ bb or cc
here is the error it gives for cc and the same error occurs for the other line_break:
>script
>java -cp .;..\..\Javasys -Dtlcif.ram.target=tlcif.ram.jvm.Jram cc
Exception in thread "main" java.lang.NoClassDefFoundError: cc
>-Dtlcif.ram.symtab=none -Dtlcif
ram.code=elevcct.JramApp elevcct.DemoGUI
'-Dtlcif.ram.symtab' is not recognized as an internal or external command,
operable program or batch file.
Could you tell me if this is the right way to proceed?
Thank you.
Thank you for getting back to me.
Here’s what I tried to do:
here is my command in the script.bat file:
java -cp .;..\..\Javasys -Dtlcif.ram.target=tlcif.ram.jvm.Jram -Dtlcif.ram.symtab=none -Dtlcif.ram.code=elevcct.JramApp elevcct.DemoGUI
it’s on a single line, with what you suggested it becomes:
java -cp .;..\..\Javasys -Dtlcif.ram.target=tlcif.ram.jvm.Jram line_break
-Dtlcif.ram.symtab=none -Dtlcif.ram.code=elevcct.JramApp elevcct.DemoGUI
with line_break = xxx \ or aa \ or \ bb or cc
here is the error it gives for cc and the same error occurs for the other line_break:
>script
>java -cp .;..\..\Javasys -Dtlcif.ram.target=tlcif.ram.jvm.Jram cc
Exception in thread "main" java.lang.NoClassDefFoundError: cc
>-Dtlcif.ram.symtab=none -Dtlcif
ram.code=elevcct.JramApp elevcct.DemoGUI
'-Dtlcif.ram.symtab' is not recognized as an internal or external command,
operable program or batch file.
Could you tell me if this is the right way to proceed?
Thank you.
the last character of the line before <enter> is the \
java -cp .;..\..\Javasys -Dtlcif.ram.target=tlcif.ram.jvm.Jram \<enter>
-Dtlcif.ram.symtab=none -Dtlcif.ram.code=elevcct.JramApp elevcct.DemoGUI
java -cp .;..\..\Javasys -Dtlcif.ram.target=tlcif.ram.jvm.Jram \<enter>
-Dtlcif.ram.symtab=none -Dtlcif.ram.code=elevcct.JramApp elevcct.DemoGUI
Hello,
Thank you for responding again.
The solution you propose is for the UNIX (Linux) system, not for Windows. The \ is used to escape the character that follows it, so it represents a line break on Unix. On Windows, there are two characters for end of line and carriage return.
There is the solution of environment variables, but our command can remain long if we have many options.
Thank you.
Thank you for responding again.
The solution you propose is for the UNIX (Linux) system, not for Windows. The \ is used to escape the character that follows it, so it represents a line break on Unix. On Windows, there are two characters for end of line and carriage return.
There is the solution of environment variables, but our command can remain long if we have many options.
Thank you.