【问题标题】:How does one redirect %temp% in batch file to a text file?如何将批处理文件中的 %temp% 重定向到文本文件?
【发布时间】:2013-10-27 14:50:18
【问题描述】:

这是我在批处理文件中的行:

echo InstallPath="%temp%\\~tmp.B1FPXLAEP" > file.txt

我希望内容保持不变,但是当我运行批处理文件时,它会添加 %temp% 文件夹的完整位置。

有没有办法做到这一点?

【问题讨论】:

  • 注意,您使用的是重定向,而不是管道

标签: batch-file echo pipe temp


【解决方案1】:
echo InstallPath="%%temp%%\~tmp.B1FPXLAEP" > file.txt

%escape%

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-03
    • 1970-01-01
    相关资源
    最近更新 更多