mcneilyo
mcneilyo

Reputation: 95

Batch filenames - Consectutive '>' '>' symbols in a line

A nice easy question. How do I write out the following line to a alert.cmd file? This .cmd file will be called externally. As you can see, I have 2 consecutive > symbols, and so the resultant line in the alert.cmd is incomplete. I've spaced things out to make clear.

echo echo Blah blah blah > alert.txt >> alert.cmd

I want the line in the alert.cmd file to be as follows.

echo Blah Blah Blah > alert.txt

I understand I could probably set this from an external file, but I want to keep things simple. I also dont want rabbit ears in my alert.cmd file.

Cheers

Upvotes: 0

Views: 138

Answers (1)

Stephan
Stephan

Reputation: 56180

you will have to escape special chars in the echoed string with a caret (^):

echo echo Blah blah blah ^> alert.txt >>alert.cmd

Upvotes: 2

Related Questions