I'm trying to figure out a simple way to get a list of file names from a parent folder and all of its subfolders.
Currently, I’m using the command prompt with
dir /b /s /o:ng>Directory.txt
to print the filenames and pathways of all the files in the main folder and the subdirectories, but I also want to get a printout of just the names of the files. I can enter each subfolder and simply print a directory, but there has to be a more automated way.
I have tried using variations of the the command
(for /D /R %F in (*) do dir %F /b /o:ng) > mytextfile.txt
but it isn't working.
On a funny note, in my quest to figure this out I managed to write over the content of every file in one of my folders and its subfolders with the name of the file. My IT guys were impressed, but cautioned me to respect the power of the Command Prompt in the future
They aren't sure how I did it (nor am I), and unfortunately they don't know how to do what I want. Thank goodness for backups!
Thanks in advance for any help.