如何在文件名中使用%重命名文件?

时间:2015-10-26 18:28:15

标签: windows batch-file

我编写了一个批处理脚本来重命名带有前缀的文件,但它并没有使用%作为名称的一部分重命名文件。其他文件重命名为。

例如,要将abc 10% discount.doc重命名为1234_abc 10% discount.doc,我的批处理脚本为:

rename "abc 10% discount.doc" "1234_abc 10% discount.doc"

如何使这项工作?

1 个答案:

答案 0 :(得分:1)

A%定义变量。要在字符串中使用符号本身,只需编写%%。