我正在尝试使用XCOPY和各种切换命令,尝试创建一个Windows批处理文件,用于制作单个图像文件的多个(一组数量)副本.
我想:命名要复制的文件; 说明所需的份数; 为文件的每个副本分配一个唯一的文件名.(例如原始文件0001.png,副本0001-2.png,0001-3.png等)
由于我的脚本知识有限,我非常感谢您的帮助.谢谢.
小智 23
for /l %A in (1,1,100) do copy "C:\some folder\file.ext" "C:\some folder\file-%A.ext"
Run Code Online (Sandbox Code Playgroud)
看到 for /?
在批处理文件中使用%%A
而不是%A
在命令提示符下.
FOR /L %variable IN (start,step,end) DO command [command-parameters]
The set is a sequence of numbers from start to end, by step amount.
So (1,1,5) would generate the sequence 1 2 3 4 5 and (5,-1,1) would
generate the sequence (5 4 3 2 1)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
24372 次 |
最近记录: |