Last modified or created directory

June 26, 2009 at 15:46:37
Specs: Windows XP
Hi Friends,

I would like to know is there any command to find out the latest modified and latest created directory in windows. I surfed over the net and couldnt find anything matching. I need to incorporate this in a batch file. Can anyone help me here..

Thanks much in advance


See More: Last modified or created directory

Report •


#1
June 26, 2009 at 16:12:10
Is this going to be a repetitive task or a one time deal? If one time, WinXP has something built in that can get the job done.

Report •

#2
June 26, 2009 at 17:49:17
@echo off & setLocal enableDELAYedexpansion

for /f "tokens=* delims= " %%a in ('dir/b/ad/o-d') do (
set LM=%%a
goto :done
)
:done
echo last mod fold is !LM!


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#3
June 26, 2009 at 19:51:22
I cant get it to work without a

pause
at the end

Why is that?


Report •

Related Solutions

#4
June 27, 2009 at 00:11:20
Beats me. It works here.


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#5
June 27, 2009 at 08:38:28
thanks folks.. i would try it and let u all know.. BTW, this is not a one time requirement..

Report •

#6
June 27, 2009 at 11:10:14
many thanks mechanix.. it works great..

Report •


Ask Question