Won’t this be supported by your Operating System? Either by the file manager or through a cmd line?
In Win it will be something like this:
1. Open the command line at the folder of interest.
2. Enter “dir > listmyfolder.txt” (without quotes) to list the files and folders contained in the folder.
I’m sure Unix (Mac OS) would have a similar command (ls) as well.
Regards,
Jaap.