![](/uploads/1/2/5/7/125746148/827560504.jpg)
Dec 06, 2015 Batch rename files. Now the next thing you want to do is to rename the files sequentially. To do this, press Ctrl+A to select all the files in that folder. Now rename the first file. From time to time I need to renumber the files in a folder to make room for additional files. I currently manage it by removing the old sequence.
Active2 years, 5 months ago
I picked up the code below from another post. I believe it should pick up the current directory folder and include it in the renaming part of the process, however that doesn't seem to work for me.
I have a .txt file that will be received into a folder each day named and time stamped. Example as below:
FileNameA_20170418153000.txt
Essentially I'd like to amend the code above to rename the file:
filenam0001.txt
and continue to update the sequence number (which works perfectly well).i.e.
filenam0001.txt
filenam0002.txt
filenam0003.txt
Watch samurai flamenco. Any help would be greatly appreciated.
![Folder Folder](/uploads/1/2/5/7/125746148/326891055.jpg)
3,31566 gold badges2929 silver badges5454 bronze badges
![Batch file rename files in folder with sequential numbers Batch file rename files in folder with sequential numbers](/uploads/1/2/5/7/125746148/746348175.png)
Andrew-W-Andrew-W-
2 Answers
you need to add the leading zeros manually (add some zeros, then cut the last x characters):
StephanStephan39k55 gold badges3535 silver badges6363 bronze badges
I modified your code in order to insert the leading zeros in a simple way..
AaciniAacini54k99 gold badges5757 silver badges8383 bronze badges
Not the answer you're looking for? Browse other questions tagged batch-file or ask your own question.
![](/uploads/1/2/5/7/125746148/827560504.jpg)