I'm looking to grab a list of the directories into a text document using a .bat file or the command line.
The problem I'm facing is that I have roughly twelve hard drives with a few folders in it, then inside those directories are around 163 more folders and I have to catalog them all. Doing this by hand would be a huge task and I'm looking to simplify it.
If you need any more information please just ask and I will provide it.
3 Answers
You can try different params like /s. How you will do in multiple drives is another matter. You'd end up writing a .bat file which loops through different drives and run the command below. Or simply run this from every drive and collate the results.
dir /s > fileNames.txt
The above will create a fileNames.txt with all dir names.
HTH
Try:
tree C: > out.txt
tree D: >> out.txt
...
tree Z: >> out.txt
You will need to do some editing, but the escape characters do help with the heirarchy.
You want the dir command with the flag /s.