问题描述:

I am using batch file to write to a file, and want to not add the same thing if it already being added. I have tried this which has worked.

find "jackdows loves me" %appdata%\data.html || echo jackdows loves me >>%appdata%\data.html

However, I can't make this one work as there are special chars:

find "<!-- saved from url=(0017)http://localhost/ -->" %appdata%\data.html || echo <!-- saved from url=(0017)http://localhost/ --> >>%appdata%\data.html

What is the correct way to do that?

网友答案:

To escape < and > in anything in the NT line of OSs, use the caret:

echo ^< > test.out

相关阅读:
Top