Forum Moderators: phranque
But I wanted it copied and renamed like this:
1Filename.txt
2Filename.txt
3Filename.txt
Etc. up to 1000.
It's pretty easy to make 1000 copies of the same file, but it messes up how it is named.
They end up looking like this: Copy 1 of Filename.txt, Copy 2 of Filename.txt, etc.
Does anyone know a way to do this?
I've downloaded a file re-namer utitlity, but it doesn't make copies of the file, just re-names files you already have.
I am using windows, yes.
I actually just used what I said above as an example, but am wishing I said exactly what I need now, lol.
I'm actually only making 59 copies of 1 file.
It starts at 18502Filename.txt
And I need that same file copied and to go up to 18560Filename.txt.
I know it probably would only probably take me about 10 minutes to just make 59 copies of the file and manually re-name them, but we have to do this on a pretty regular basis and I'm just looking for an easier way.
With that said, could I still use a similar code to what you have there? Couldn't quite figure it out.
But I can't quite figure out how to make it start at 18502 and go up from there.
Just had to change the "1000" part to 59 and it made 59 copies.
But I want the copy numbers to go:
18502Filename.txt
18503Filename.txt
18504Filename.txt
etc.
Rather than:
1Filename.txt
2Filename.txt
3Filename.txt
etc.
Use an iterative variable to set the starting value (start#) and then step through a set range of values until the value exceeds the set ending value (end#). /L will execute the iterative by comparing start# with end#. If start# is less than end# the command will execute. When the iterative variable exceeds end# the command shell exists the loop. You can also use a negative step# to step through a range in decreasing values. For example, (1,1,5) generates the sequence 1 2 3 4 5 and (5,-1,1) generates the sequence (5 4 3 2 1)). The syntax is:for /L {%% ¦ %} variable in (start#,step#,end#) do command[CommandLineOptions]
Therefore ...
C:\>for /L %f in (18502,1,18560) do copy C:\Temp\18502Filename.txt C:\Temp\%fFilename.txt