It has nothing to do with ECHO. The behavior is strictly controlled by how the batch script ends. This is even true for a batch script without any commands
There are two possible outcomes when batch processing terminates:
outcome 1 - There is an extra blank line above the prompt that appears after the batch output.
outcome 2 - The prompt appears directly below the batch output without an extra blank lineHere are some scenarios that yield outcome 1:
1) an empty script
2) The script contains a single line without linefeed (0A). The line consists solely of token delimiters and/or carriage returns (0D).
3) The last command is not terminated by 0A or 1A.
3) The last command is terminated by a single 0A or 1A. There may be a subsequent line containing token delimiters and/or 0D, but there are no additional 0A or 1A.Here are some scenarios that yield outcome 2:
1) The file consists of a single line consisting of 0 or more whitespace characters and/or token delimiters, terminated by 0A or 1A
2) The last line is a label, or a label hack comment
3) The last command is terminated by 0A or 1A, and at least one additional 0A or 1A follows. There may or may not be token delimiters or 0D on the subsequent lines.
Note that the batch parser largely treats 1A the same as 0A