【问题标题】:Batch: Set the path for a file created by batch批处理:设置批处理创建的文件的路径
【发布时间】:2014-02-08 08:58:01
【问题描述】:

我正在尝试创建一个小程序,它将在 c 驱动器上创建一个 .txt 文件,它应该向其中添加 %random% 的文本,但我该如何设置路径?

【问题讨论】:

  • echo %random% >c:\path\file.txt ?

标签: file batch-file random cmd


【解决方案1】:
type %random% > c:\create.txt

-> 这会将 %random% 的内容添加到您的文本文件 create.txt。
-> 如果您已经知道 %random% 的路径,可以将其设置为环境变量。
-> 否则,可以使用 echo 命令。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-18
    • 2013-09-25
    • 2013-08-31
    • 2015-04-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多