How to insert a carriage return with batch
Sometimes the quickest way to accomplish something in Windows is with a simple batch file. The best example would be when you want to run a command and append the contents of it to a text file for later perusal. Occasionally, I’ve had a desire to run multiple commands and append them to the same file, but I like to separate the output from the various commands by some whitespace to make it easier to look at later. I’ve always just echo’d some arbitrary character to the file to cause blank lines to show up, like this: echo _ >> somefile.txt
I realized today that there’s actually an easy way to simply echo a carriage return or line feed instead, by just issuing an echo command followed immediately by a period (no space in between), like this: echo. >> somefile.txt.
Thought I’d share it with the rest of you who didn’t know this already. Those of you who knew, you can pin a rose on your nose, and just don’t mock me too much.
Other articles you might find useful:

Thank you very much, I needed this
Ahhh, but why does it work? I’ve used it for years and years and regarded it as a tweak that just worked.
But there is a reason! By design, cmd.exe will interpret what you “echo”. So, to get it to just darn well echo what you’re telling it to, but still be able to pass parameters, you need a way to tell it which is which.
All credit goes to Raymond Chen at his blog:
http://blogs.msdn.com/oldnewthing/archive/2008/04/03/8352719.aspx
Matias: You’re welcome!
Andrew: Excellent information! I had never thought before of why it worked. Nice to gain a little revelation every once in a while and realize that something like that actually has some reasoning behind it
Great article from Raymond Chen. Thanks for sharing!
From the comments on Raymond’s post, it looks like people were trying to suggest a similar method for doing the same thing with echo on a *nix system. I don’t know if this is the case on all *nix’es, but at least on Slackware and Debian distributions of Linux, I’m able to accomplish a blank line/carriage return by simply using: echo >> somefile (echo followed by nothing).
Why did it take me so long to find this??? I have been for an hour trying to find out how to perform a carriage return in DOS using the “echo” command. I have tried
echo “Hello\nWorld”
and using the -e and \n and \\n but DOS always interprets it literally. If anyone can help, please let me know. This worked to create a new line for me, thanks.
You are a champion! Took me ages to find this out (I had the same problems as Adam).
Now my text file output is legible
Glad it helped!
Well thank YOU! This was driving me crazy today.
I have been trying to do this for decades!
Thank You! Been going crazy over the years trying to work around this.
Cheers for this. I have been struggling with this for an hour, and searching for a solution for 3 hours. It’s doesn’t help when so many so called “Professional Coders” give out completely the wrong solution without actually trying it for themselves.
OK, they may think that DOS is be beneath their superior intellect but they make themselves look stupid, and frustrate us lesser mortals by doing this. It only takes a few minutes to test your solutions, and it will earn them a much better reputation.
And as far as I’m concerned, All credit goes to Technical Tom as it was this page I found. I’ve never heard of Raymond Chen
Good, thank you!
Elegant. Thank you.
Searched everywhere for this, so simple. Many thanks.