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

Posted on 2007-07-31
Medium Priority
Last Modified: 2012-06-21
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?
Question by:bkapla1
  • 2
LVL 29

Expert Comment

by:Michael Pfister
ID: 19599652
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,

LVL 29

Accepted Solution

Michael Pfister earned 2000 total points
ID: 19599693
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

Author Comment

ID: 19599701

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


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Know the reasons and solutions to move/import EDB to New Exchange Server. Also, find out how to recover an Exchange .edb file and to restore the file back.
Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question