如何批量添加“null”到文本文件?

时间:2013-06-24 15:01:24

标签: windows batch-file

我有这样的问题。假设我想将此代码写入文本文件。

echo taskkill / IM wscript.exe / F>空

我该怎么做?

感谢vendettamit,Matteo Italia和Roger Lipscombe:)

2 个答案:

答案 0 :(得分:5)

In batch the caret (^) is the escape character;因此:

echo taskkill /IM wscript.exe /F ^>null >file.txt

顺便说一句,我想你的意思是>NUL>null只会将数据写入名为null的文件中。

答案 1 :(得分:3)

试试这个:

   ECHO taskkill .IM wscript.exe /F ^> null > yourFile.txt