Home All Groups Group Topic Archive Search About
Author
8 Sep 2006 3:16 PM
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?

Author
8 Sep 2006 3:38 PM
Patrice
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...

--
Patrice

"Gabe Matteson" <gmattesonATinqueryDOTbiz> a écrit dans le message de news:
eMDRkk10GHA.3***@TK2MSFTNGP04.phx.gbl...
Show quoteHide quote
>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?
>
Author
8 Sep 2006 8:55 PM
Gabe Matteson
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















Show quoteHide quote
"Patrice" <scr***@chez.com> wrote in message
news:%23qjyoz10GHA.1268@TK2MSFTNGP02.phx.gbl...
> 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...
>
> --
> Patrice
>
> "Gabe Matteson" <gmattesonATinqueryDOTbiz> a écrit dans le message de
> news: eMDRkk10GHA.3***@TK2MSFTNGP04.phx.gbl...
>>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?
>>
>
>
Author
11 Sep 2006 8:05 AM
Patrice
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.
--

"Gabe Matteson" <gmattesonATinqueryDOTbiz> a écrit dans le message de news:
uwW%23Mi40GHA.4***@TK2MSFTNGP05.phx.gbl...
Show quoteHide quote
> 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
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> "Patrice" <scr***@chez.com> wrote in message
> news:%23qjyoz10GHA.1268@TK2MSFTNGP02.phx.gbl...
>> 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...
>>
>> --
>> Patrice
>>
>> "Gabe Matteson" <gmattesonATinqueryDOTbiz> a écrit dans le message de
>> news: eMDRkk10GHA.3***@TK2MSFTNGP04.phx.gbl...
>>>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?
>>>
>>
>>
>
>
Author
8 Sep 2006 6:28 PM
Herfried K. Wagner [MVP]
"Gabe Matteson" <gmattesonATinqueryDOTbiz> schrieb:
>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?

<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/FileSystemEnumerator.zip>

+ 'System.IO.File.GetLastAccessTime' + 'Now' + 'DateTime' ('Date').

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>