Search code examples
windowsbatch-filecommand-linebatch-processing

how to split long command line in multiple lines with quote inside?


How can i write this multiline command:

"my.exe"^
 -Libraries="toto;^
tutu"^

it's work well for the first line "my.exe"^ but stop in the second line -Libraries="toto;^ and thus ignore the third line tutu"^


Solution

  • You could use:

    "my.exe"^
     -Libraries=^"toto;^
    tutu"
    

    The key is to have balanced quotes (multiple of 2) in each line, or escape unbalanced quotes to get a balanced line