Batch file to rename all files in folders at once

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
daviddc114
Posts: 19
Joined: 23 Jul 2013 12:45

Batch file to rename all files in folders at once

#1 Post by daviddc114 » 16 Jul 2014 10:06

I want to know how to batch rename files in all subfolders...

right now i have folders with 1 .jpg in them for example..
1
-image.jpg
2
-image3.jpg
3
-image4.jpg
4
-image7.jpg

and in each folder there is a .jpg image, with various names, i want to rename each .jpg to 0.jpg in all sub folders so i end up with this

1
-0.jpg
2
-0.jpg
3
-0.jpg
4
-0.jpg

the folder names are never constant, so REN would not work.. thanks for the help

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Batch file to rename all files in folders at once

#2 Post by foxidrive » 16 Jul 2014 10:14

Code: Select all

@echo off
for /r %%a in (*.jpg) do ren "%%a" "0.jpg"

Post Reply