How to echo >>someText in a Windows batch file

2020-04-26 23:45发布

I want to print to the console the exact text ">>someText"

I try

echo abb >>"cdd eee"

but that will print nothing and create file cdd with abb text inside it.

What syntax should I go with echo for that?

3条回答
乱世女痞
2楼-- · 2020-04-26 23:57

you have to "escape" special chars like > with a caret ^:

echo abb ^>^>"cdd eee"
查看更多
我欲成王,谁敢阻挡
3楼-- · 2020-04-27 00:15

Use carat to escape the characters echo ^>^>your text

C:\echo ^>^>"cdd eee"
>>cdd
查看更多
可以哭但决不认输i
4楼-- · 2020-04-27 00:17

Use quotes

echo ">> cdd"
查看更多
登录 后发表回答