I need to find the age of a file

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
twoods
Newbie
Posts: 1
Joined: Tue Jul 08, 2003 8:42 pm

I need to find the age of a file

Post by twoods » Tue Jul 08, 2003 8:45 pm

What I'm trying to do is write a script to delete all files in a directory that are older than 7 days. I can get the FileDate, but that does me little good in the YYYYMMDD format. Any suggetions?

Thanks,

Tom

Lumumba

Post by Lumumba » Wed Jul 09, 2003 7:18 am

VBScript?

or less rocket sience ...

Code: Select all

GetDate>date
MessageModal>%date%
Sub>%date%,7
MessageModal>%date%
So play around with Midstr> ...

Maybe such kind of output would be a usefull source to compare with (here C:Drive):

Code: Select all

Run Program>cmd dir C:\*.* /O:D /A:-D-H-S /-C > c:\ContentOfCDrive.txt
cmd=NT/XP/W2K
command=W9x/ME

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts