|Below is just one method of renaming, change the paths to suit your needs:|
:: Code begins...
for /f "tokens=1-3 delims=." %%1 in ('dir /a-d /b %temp%\*.bmp') do (
set ext=%%3 & call :renameit
ren %temp%\%reject%.%name%.%ext% %name%.%ext%
:: Code ends....
Hope this helps, also hope it's not homework!.