Код:

@Echo Off
SetLocal EnableDelayedExpansion
::-----------------------
Set "TXT=Не найден файл "
::-----------------------
Set/A "ln=0,li=0"
(For /F "Delims=" %%a In ('DIR/B/OD *.log') Do (
For /F "Tokens=1*" %%b In ('Find "%TXT%"^<"%%a"') Do (
If Not "%%b"=="!$b!" Set "ln=!li!"& Set "$b=%%b"
Set "$c=%%c"& Set/A li+=2
Echo ;%%a
Echo !$c:*%TXT%=!
)))>temp1.txt
More +%ln% temp1.txt >temp2.txt
Sort /L "C" "temp2.txt" /O "temp2.tmp"
(For /F "UseBackQ Delims=" %%a In ("temp2.tmp") Do (
If /I Not "%%a"=="!$a!" Echo %%a
Set "$a=%%a"
))>"temp3.txt"