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

Posted on 2007-07-31
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
    LVL 28

    Expert Comment

    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 28

    Accepted Solution

    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


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


    Featured Post

    Too many email signature updates to deal with?

    Are you constantly visiting users’ desks making changes to email signatures? Feel like it’s taking up all of your time? Wish you could manage all signatures from one central location, easily design them and deploy them quickly to users? Well, there is an easy way!

    Join & Write a Comment

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now