How to redirect symbol `>` to .txt in batch file

时间:2016-04-04 16:52:58

标签: batch-file redirect command-line cmd

I am trying to redirect the symbol > in a batch file to a .txt file and failing.

Example:

echo > > m.txt

So when I open the file m.txt I should see this:

>

1 个答案:

答案 0 :(得分:2)

you need to escape some special chars: echo ^> >m.txt

Other characters that need escaping: |&<> and % which is an exception: it is escaped with another %: %%