Search code examples
batch-filerenamefile-renamebatch-rename

Batch Script to Rename JPEGS adding a 1 to the end


I have a large amount of JPEGs inside subfolders that I need to rename to their current name with an extra 1 at the end.

For example:

G:\FILENAME\Subfolder1\subfolder2\JPEGNAME.JPG

Want to rename to

G:\FILENAME\Subfolder1\subfolder2\JPEGNAME1.JPG

I have over 900 files in this format that I need to rename.

Any help?


Solution

  • edit I added /r as I see you have a tree of files to modify. Type this command in the main holding folder of the JPG files.

    Here's a cmd prompt command. Delete the echo if you like what you see on the console.

    for /r %a in (*.jpg) do echo rename "%a" "%~na1%~xa"