Код:

@echo off
set "dir=D:\Test"
for /f "delims=" %%i in ('"2>nul dir/a-d/b/s "%dir%\default.htm""') do (
pushd "%%~dpi"
for /f "delims=" %%j in ('powershell "($x='*'+((gc 'default.htm')-match '<title>..*</title>')+'*'-split '<title>'-split '</title>'-replace '[*\\|:\"\"<>/?</]','_' )[1]"') do (
ren "%%i" "%%j.htm"
)
popd
)
exit/b 0