I have made a batch file from which you can save all the names and extensions of the files and folders in the folder the batch file is (For e.g. the batch file is in C:\, then it will save the names of all the files and folders of C:\). You will just need to run the file and it will automatically create a file called Result.txt in the same folder and it will save the names in it.
Download Link-
File & Folder Name Detector.bat