finding oldest folder

March 23, 2009 at 04:48:53
Specs: Windows Vista
Like this script finds the oldest file

@echo off
for /f "tokens=*" %%F in ('dir *.* /b /a-d /o-d') do set Oldest=%%F
echo Oldest=%oldest%

How can I find the oldest folder?


See More: finding oldest folder

Report •


#1
March 23, 2009 at 06:16:29
Just replace /a-d by /ad

@echo off
for /f "tokens=*" %%F in ('dir *.* /b /ad /o-d') do set
Oldest=%%F
echo Oldest=%oldest%

--
Holla.


Report •
Related Solutions


Ask Question