If one needs to use famous \n in string literals that can be passed to a variable, may write a code like in the *Hello.bat* script below:
@echo off
set input=%1
if defined input (
set answer=Hi!\nWhy did you call me a %input%?
) else (
set answer=Hi!\nHow are you?\nWe are friends, you know?\nYou can call me by name.
)
setlocal enableDelayedExpansion
set newline=^
rem Two empty lines above are essential
echo %answer:\n=!newline!%
This way multiline output may by prepared in one place, even in other scritpt or external file, and printed in another.
The line break is held in *newline* variable. Its value must be substituted **after** the *echo* line is expanded so I use *setlocal enableDelayedExpansion* to enable exclamation signs which expand variables on execution. And the execution substitutes *\n* with *newline* contents (look for syntax at *help set*). We could of course use *!newline!* while setting the *answer* but *\n* is more convenient. It may be passed from outside (try *Hello R2\nD2*), where nobody knows the name of variable holding the line break (Yes, *Hello C3!newline!P0* works the same way).
Above example may be refined to a subroutine or standalone batch, used like `call:mlecho Hi\nI'm your comuter`:
:mlecho
setlocal enableDelayedExpansion
set text=%*
set nl=^
echo %text:\n=!nl!%
goto:eof
Please note, that additional backslash won't prevent the script from parsing \n substring.