Navigate to folder and run following command
dir > FileName.txt
or
dir >Complete Folder Path/Filename.txt
dir >> Filename.txt will append data to existing file
dir /s > FileName.txt will include sub-directories
dir /b > Filename.txt will save in Bare format
For more options run dir /?
dir > FileName.txt
or
dir >
dir /s > FileName.txt will include sub-directories
dir /b > Filename.txt will save in Bare format
For more options run dir /?