1

I have this for a batch file. I know squat about batch files.

FOR /r %%x IN (*.BMP,*.GIF,*.JPG,*.PNG) DO REN "%%x" *.jpeg

Which works fine locally. I need this to work across multiple drives (c:,d:,e:,f:,g:,h:,i:,j:).

Any help would be greatly appreciated. Thank you for your time and effort.

Cheers!

1
  • Why do you want to change the file extension of different image types to .jpeg? Why do you even want to change .jpg files to .jpeg? .jpeg is an erroneous extension that shouldn't even exist.
    – paradroid
    Mar 29, 2014 at 16:55

1 Answer 1

1

Here's a batch script that does what you want:

@echo off
setlocal

set drives=c,d,e,f,g,h,i,j
set exts=*.bmp;*.gif;*.jpg;*.png

for %%A in (%drives%) do (
cd /d %%A: && for /r %%B in (%exts%) do ren "%%~B" "%%~nB.jpeg"
)

pause >nul
endlocal & exit /b

Further reading

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .