@echo off     
echo *******File bulk rename*******   
echo.
echo.

set /p suffix=Please enter the file type:
IF "%suffix%"==""   echo.File type cannot be empty &goto error
IF NOT EXIST *.%suffix% echo.The format file does not exist &goto error

set /p filename=Please enter the file name prefix:
IF "%filename%"=="" set "filename=%%~ni"

setlocal ENABLEDELAYEDEXPANSION
for /r %%i in (.) do (
        set n=1000
        for /f "delims=" %%a in (' dir /b "%%i\*.%suffix%" 2^>nul ') do (
                set /a n+=1
                ren "%%i\%%a" "%filename%"!n:~1!%%~xa
        )
)
echo. &pause
exit
:error
echo. &pause