How to write a multiline command? How to write a multiline command? windows windows

How to write a multiline command?


After trying almost every key on my keyboard:

C:\Users\Tim>cd ^Mehr? DesktopC:\Users\Tim\Desktop>

So it seems to be the ^ key.


In the Windows Command Prompt the ^ is used to escape the next character on the command line. (Like \ is used in strings.) Characters that need to be used in the command line as they are should have a ^ prefixed to them, hence that's why it works for the newline.

For reference the characters that need escaping (if specified as command arguments and not within quotes) are: &|()

So the equivalent of your linux example would be (the More? being a prompt):

C:\> dir ^More? C:\Windows


The caret character works, however the next line should not start with double quotes. e.g. this will not work:

C:\ ^"SampleText" ..

Start next line without double quotes (not a valid example, just to illustrate)