如何回显"2"? (无引号)到批处理脚本中的文件?

问题描述:

如何从批处理脚本中将数字 2 回显到文件中?

How do I echo the number 2 into a file, from a batch script?

这不起作用:

Echo 2>> file.txt

因为2>>是一个特殊命令. :(

because 2>> is a special command. :(

使用(ECHO 2)>>file.txt.这将输出2,不带任何空格.

Use (ECHO 2)>>file.txt. This will output 2 without any spaces.