Solved Batch File to rename files in a folder

December 5, 2012 at 13:47:34
Specs: Windows 7

Batch File to rename files in a folder

How would with batch rename each file in a folder of images ending in .jpg


afasdf.jpg
asigjgja.jpg
sagwerijgrg.jpg

to change them to be like this:

1.jpg
2.jpg
3.jpg
...
...
to 5000 for each file in the folder increasing by one and renaming that file


See More: Batch File to rename files in a folder

Report •


#1
December 5, 2012 at 16:46:08
✔ Best Answer

This might do it:
@for /f "tokens=1* delims=[]" %%a in ('dir /b *.jpg ^|find /n /v ""') do ren "%%b" %%a.jpg

If the filenames might later possibly be relevant, I would suggest making a cross-reference text file, or append the original name to the back-end of the jpg using copy /b.


Report •
Related Solutions


Ask Question