I'm experimenting with XCOPY and various switch commands, in attempting to create a Windows batch file for making multiple (a set number) copies of a single image file.
I'd like to : name the file to be copied; state the number of copies required; have each copy of the file assigned a unique filename. (eg original file 0001.png, with copies 0001-2.png, 0001-3.png, etc)
I'd greatly appreciate help with this, as my scripting knowledge is limited. Thank you.
for /l %A in (1,1,100) do copy "C:\some folder\file.ext" "C:\some folder\file-%A.ext"
See for /?
In a batch file use %%A
rather than %A
at the command prompt.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With