1.

Solve : sorting output of dir command?

Answer»

I am trying to use the DIR command to sort all files with the same extension through all the SUBDIRECTORIES by their CREATION date (date written) and output that to a text file. I can get it to work with one problem. The sorting is done within each subdirectory first, and I want it to sort and output all filenames by creation date regardless of subdirectory. Basically I want to use this to generate lists of all my MP3 files listed by newest to oldest disregarding how they are organized on the drive. I know there are other ways to do it, but I want a dos-based batch file! Any help would be appreciated!UNLESS I'm missing the obvious (wouldn't be the first time ), this is harder than it appears.

This will work if and only if your date settings are formatted year-month-day, with or without delimiters:

dir /s /tc path\*.mp3 | sort /r /o mp3.lst

Note: there will be garbage records in mp3.lst that have to be MANUALLY removed.

One of the many script languages would be a better choice.

Hope this helps.



Discussion

No Comment Found