Give a shout for this batch file :
@echo off
Set "Folder=%~dp0"
Set "Log=%~n0.txt"
If Exist "%Log%" Del "%Log%"
for /f %%f in ('Dir /b /s "%Folder%"') do echo "%%f" >> "%Log%"
Start "" "%Log%"
Or something like that as @Ashwani Kumar posted in the comments :
Batch Files: List all files in a directory with relative paths
@echo off
Set "Folder=%~dp0"
Set "Log=%~n0.txt"
If Exist "%Log%" Del "%Log%"
SETLOCAL DisableDelayedExpansion
SET "r=%__CD__%"
FOR /R . %%F IN (*) DO (
SET "p=%%F"
SETLOCAL EnableDelayedExpansion
ECHO("!p:%r%=!" >> "%Log%"
ENDLOCAL
)
Start "" "%Log%"