@echo off
setlocal enabledelayedexpansion
set /p "old_ext=Enter the old file extension to be renamed (without the dot): "
set /p "new_ext=Enter the new file extension to rename to (without the dot): "
set "folder_path=%~dp0"
cd /d "%folder_path%"
for %%i in (*.%old_ext%) do (
set "filename=%%~ni"
ren "%%i" "!filename!.%new_ext%"
)
echo All files renamed successfully!