Click here for important information about

utility to sort entire HDD by modified date?

Microsoft Windows xp professional w/serv...
April 8, 2011 at 05:14:37
Specs: WinXPProx32, C2D8400; 2GB RAM
I frequently use the utility WinDirStatPortable to display in a single window which directories in a given volume are the largest by size, number of files, etc. This is very useful in figuring out where all your hard drive space has gone.

Is anyone aware of a utility that could parse an entire directory and display similar results sorted by MODIFIED DATE? This would be incredibly useful in determining which files in a system change frequently/recently, and which ones have not been changed for quite some time.


See More: utility to sort entire HDD by modified date?

April 8, 2011 at 05:21:26
dir /OD

Report •

April 11, 2011 at 13:39:47
i should have specified, all directories AND SUBDIRECTORIES, so if a file in C:\Windows\System32\subdir1\subdir1\subdirxyz\ was changed at the same date and time as a file in C:\documents and settings\administrator\desktop\my music\billy bob\3rd album\, those 2 files would show up right next to each other in the output because the MODIFY DATES were so close.

anyone know of such a tool?

Report •

April 11, 2011 at 14:18:19
Every try using explorer to search on *.* with c:\ selected and subdirs also selected then sort on modified date?

Answers are only as good as the information you provide.
How to properly post a question:
Sorry no tech support via PM's

Report •

Related Solutions

April 12, 2011 at 08:26:55
dir "C:\documents and settings\administrator\desktop\my music\" /OD /s

What do you want to do with the list once you have it?

Report •

April 12, 2011 at 08:55:45
the dir /OD option still only shows that directory. i want to see them all in the same search, compared to each other, instead of inspecting 1 directory at a time.

the windows search would work, but would take hours or even days to run. I was hoping for a utility that does the search in seconds or minutes.

the point would be to analyze an entire server for files that have not been modified in several years, in order to determine which files were still in play and which ones can be migrated to archive.

Report •

April 12, 2011 at 09:38:47
doesn't take hours using explorer. If it does, no utility is going to make any difference since your volume of data is extensive.

Answers are only as good as the information you provide.
How to properly post a question:
Sorry no tech support via PM's

Report •

April 12, 2011 at 10:48:27
"the dir /OD option still only shows that directory."

Use the "/S" switch and it will show the sub directories.

You can do it out to a XLS or TXT file so that you can work with it. Use the following command...

DIR /OD /S > MyList.txt

If you need script to copy files using a date range I would use ROBOCOPY because it has built in date functions. It comes with the 2003 Server Resource Kit...

Download the free tools and install them. Then do a ROBOCOPY /? to get the man page on how to use it.

If you are just looking to do a cleanup here is an example of a monthly cleanup script I made to cleanup files older than a certain age...

@echo off
setLocal EnableDELAYedExpansion

if "%1"=="" (
  echo Must specify a tombstone [number of days].
  goto :EOF
if "%2"=="" (
  echo Must specify a source directory.
  goto :EOF

Set Day=%Date:~-7,2%
Set Month=%Date:~-10,2%
Set Year=%Date:~-4,4%

Call :jdate %Year% %Month% %Day%
Set /a CompairDate=%jdate%
Set /a CompairDate=!CompairDate!-%1 
Set FileDate=1

for /f "tokens=*" %%a in ('dir %2 /s/b') do (
  set T=%%~Ta
  set FileDay=!T:~3,2!
  set FileMonth=!T:~0,2!
  set FileYear=!T:~6,4!
  call :jdate !FileYear! !FileMonth! !FileDay!
  set /a FileDate=!Jdate!
  if "!FileDate!" lss "!CompairDate!" (
    attrib "%%a" -r /s
    @echo y|del "%%a" /s /q
    echo *Deleted* %%a !FileMonth!-!FileDay!-!FileYear!
Goto :EOF

:: Convert date to Julian
:: Arguments : YYYY MM DD
:: Returns   : Julian date
:: First strip leading zeroes
IF %MM:~0,1% EQU 0 SET MM=%MM:~1%
IF %DD:~0,1% EQU 0 SET DD=%DD:~1%
:: Algorithm based on Fliegel-Van Flandern
:: algorithm from the Astronomical Almanac,
:: provided by Doctor Fenton on the Math Forum
:: (,
:: and converted to batch code by Ron Bakowski.
SET /A Month1 = ( %MM% - 14 ) / 12
SET /A Year1  = %1 + 4800
SET /A JDate  = 1461 * ( %Year1% + %Month1% ) / 4 + 367 * ( %MM% - 2 -12 * %Month1% ) / 12 - ( 3 * ( ( %Year1% + %Month1% + 100 ) / 100 ) ) / 4 + %DD% - 32075
SET Month1=
SET Year1=


You make a BAT file with this script then to use it you pass the Tumbstone in number of days (ie if you want to delete files more than 1 year old your tumbstone would be 350; and you have to pass the directory you want to check (ie c:\backups). I usually run the script out to a log like so...

cleanup 350 j:\backups > c:\cleanuplog.txt

hope this helps. As always do this on a test box before you go live or atleast make sure you have a good buck.

Report •

April 25, 2011 at 15:56:11
the closest i have been able to get with the DIR command outputs something like the following:

Directory of C:\

05/17/2007 04:41 PM 0 AUTOEXEC.BAT
05/17/2007 04:41 PM 0 CONFIG.SYS
09/02/2010 03:30 PM <DIR> ALTools
02/16/2011 10:53 PM <DIR> dell
04/25/2011 08:21 AM <DIR> WINDOWS
04/25/2011 08:22 AM <DIR> Program Files
6 File(s) 315,071 bytes

Directory of C:\ALTools

03/04/2003 12:53 PM 64,512 LockoutStatus.exe
09/02/2010 03:30 PM <DIR> ..
09/02/2010 03:30 PM <DIR> .
09/02/2010 03:30 PM 19,420 09022010.txt
10 File(s) 2,734,076 bytes

Directory of C:\dell

02/16/2011 10:53 PM <DIR> ..
02/16/2011 10:53 PM <DIR> .
02/16/2011 10:54 PM <DIR> drivers
0 File(s) 0 bytes

Directory of C:\WINDOWS... (etc)

but i cannot use this to sort by modified date for all files at once - i cannot quickly sort by modify date for the whole DIR in order to compare, for example, mod dates for files in the C:\ALockout directory against files in the C:\Dell directory. plus the whole line item fills the cell, so excel doesn't recognize it as a date.

it's starting to sound like what i'm looking for just doesn't exist...

Report •

Ask Question