I want to rename all the files in the directory "C:\temp\TEST\IN\" but only txt-files that end with a "D".
Here is what I tried in a batch... but both didn't work. Help highly appreciated

-----try1-----
@echo off
set Quelle="C:\temp\TEST\IN\"
Set DateiFilter="*D.txt"
for /r %Quelle% %%i in (%DateiFilter%) do rename %%i %%~niI.txt
end
-----try2-----
@echo on
setlocal enableDelayedExpansion
set Quelle="C:\temp\TEST\IN\"
Set DateiFilter="*.txt"
set y="D"
set z="I"
for /r %Quelle% %%i in (%DateiFilter%) do (set x=%%i rename "%%i" "!x:D.txt=I.txt!")
pause
end