Batch file multi-line text

April 17, 2007 at 09:42:30
Specs: Win XP, Intel

I need to echo 5 lines into a text document.
I need to creat the document then echo five individal lines.
This is what i have so far
@echo off >> "Show Desktop.txt"
echo [Shell] adfadf>"Show Desktop.txt"

but when add the seccond echo it does not show up in the text doc.

Mike


See More: Batch file multi-line text

Report •


#1
April 17, 2007 at 09:51:19

Your use of redirectors is improper as ONE redirector (>) wipes out any previous content while TWO redirectors (>>) add the stream to the stored items (or create a new file if the one selected does not exist).

So modify your script as below

@Echo Off > "Show Desktop.txt"
Echo [Shell] adfadf>> "Show Desktop.txt"


Report •
Related Solutions


Ask Question