我正在编写一个批处理文件,其中需要输出一个包含'!‘的字符串。到另一个文件。但当我将该字符串回显到另一个文件时,它删除了"!“从输出中。
例如:输入:
set LINE=Hi this is! output
echo !LINE!>>new_file.txt
new_file.txt中的输出为:
Hi this is output
另外,如果输入是
set LINE=Hello!! this is output!!
echo !LINE!>>new_file.txt
New_file.txt格式的输出:
Hello
因此,它跳过了!(感叹号)从输出到new_file。如果我使用%LINE%,那么它只是在输出文件中显示"echo is on“。
请建议一种解决此问题的方法。
https://stackoverflow.com/questions/14354502
复制相似问题