How to Export List of Filenames/Info from Directory into .txt file

I need to export a list of filenames and associated information (Date Created, Date Modified and Filesize) from a directory.

I need the information exported into a .txt file, etc. so I can then perform analysis on them (e.g. I need to compare the list of files (about 1,000 files) to another list to see where any discrepancies are).  I'll use something simple like Excel for the comparison, so any output (e.g. .txt) will suffice.

I found a DOS command on the web a few weeks ago to do this, but didn't write it down or save it.  I can't seem to find it any longer.

Any suggestions?
bkapla1Asked:
Who is Participating?
 
Michael PfisterCommented:
The "/T" switch controls which date is displayed by dir:
  /T          Controls which time field displayed or used for sorting
  timefield   C  Creation
              A  Last Access
              W  Last Written

i.e. dir /tw > myfiles.txt
0
 
Michael PfisterCommented:
dir may be sufficient:

dir > myfiles.txt

dir has several option for sorting and so on, like

dir /ogne > myfiles.txt

will list directories first, then sort after filename + extension.

Hope it helps,

Michael
0
 
bkapla1Author Commented:
Michael,

Thanks, that is exactly what I needed!  Also, was much easier than the other command I found online.

Brian
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.