This is untested and destructive so test it first.- it is designed to search C: and D: drives and all subdirectories and modifies all *.config files.
It is set to look in c:\abc and d:\abc trees atm so put some files and folders in there and test it.
@echo off
for /f "delims=" %%a in ('dir c:\abc\*.config d:\abc\*.config /b /s /a-d') do (
call :sar "%%a" "%%a.tmp" "db_name" "new_db_name"
move /y "%%a.tmp" "%%a" >nul
)
goto :EOF
:sar
:: inputfile outputfile regexp_search replacement
if "%~5"=="" (set global=true) else (set global=false)
set s=regex.replace(wscript.stdin.readall,"%~4")
>_.vbs echo set regex=new regexp
>>_.vbs echo regex.global=%global%
>>_.vbs echo regEx.IgnoreCase=True
>>_.vbs echo regex.pattern="%~3"
>>_.vbs echo wscript.stdOut.write %s%
cscript /nologo _.vbs <"%~1" >"%~2"
del _.vbs
goto :EOF