File Not Accessed

  • Thread starter Thread starter Gabe Matteson
  • Start date Start date
G

Gabe Matteson

I want to be able to find out the names of files that havn't been accessed
in the past X days...

so I want to do something like this..

date.today - txtlastdays.txt

9/08/2006 - 30 days = X

is this possible?
 
Not sure what you mean by 9/08/2006 - 30 days = X days.

It would be rather something like

MaxAccessDate=Today.AddDays(-x)

That will give the date that is x days earlier than today. You can then use
this date to filter the files you want...

See The fileInfo class if the problem is to get the last access date...
 
Thanks!
It seems to add X to the days to todays date though, am i missing something?
thanks!...

Dim QueryTime As date

QueryTime = Today.AddDays(-txNotAccessed.Text)

If sFile.LastAccessTime = QueryTime Then

MsgBox(sFile)

End If
 
Well, to check this it would be really easy to just print out the value for
Query.

IMO the problme is rather that you are using = instead of <= that is you'll
have only files accessed exacltly x days ago.
--
 
Back
Top