Creating a Text File of Directory Structure and Filepath

Is there a way to generate a list of files and folders in a directory and have them output to a text file?  I need to traverse all files and folders in this directory and if possible in the file have a delimiter.
lm1189Asked:
Who is Participating?
 
Bill PrewCommented:
Sure, just do the following at a command prompt:

dir /b /s "c:\yourfolder\*.*" >results.txt

~bp
0
 
BenefordCommented:
All files (recursively) in a list:
dir /b/s

If you just want the folders
dir /b/s/ad

If you want the result in a text file, use the pipe:
dir /b /s > textfile.txt
0
 
Raj-GTSystems EngineerCommented:
dir /b >> list.txt 

Open in new window


will create a simple text file with file and folder names.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.