Код:
@echo off
for %%a in (c d e f g h i j k l m n o p q r s t u v w x y z) do (
for /f "delims=*" %%B in ('dir /s /b /a-d "%%a:\file.txt"') do set f=%%~dpBfile.txt
)
echo "1 stroka" > "%f%"
echo "2 stroka" >> "%f%"
echo "3 stroka" >> "%f%"
echo "4 stroka" >> "%f%"
echo "5 stroka" >> "%f%"
exit