If I understand correctly that you only want to rename the files from .png
to .jpg
, and not convert them, you could use the following batch code:
@ECHO OFF
PUSHD .
FOR /R %%d IN (.) DO (
cd "%%d"
IF EXIST *.png (
REN *.png *.jpg
)
)
POPD
Update: I found a better solution here that you can run right from the command line (use %%f
in stead of %f
if using this inside a batch file):
FOR /R %f IN (*.png) DO REN "%f" *.jpg
Note that the above will process the current directory and its subdirectories. If necessary, you can specify an arbitrary directory as the root, like this:
FOR /R "D:\path\to\PNGs" %f IN (*.png) DO REN "%f" *.jpg