Home All Groups Group Topic Archive Search About

find files last accessed on a certain date



Author
10 May 2005 10:10 AM
ste o'c
hi guys
can anyone point me towards the script for this

is there something in the windows 2000 resource kit that could do this either

tx again
stephen

Author
10 May 2005 5:31 PM
Yimin Wei
ste o'c wrote:
> hi guys
> can anyone point me towards the script for this
>
> is there something in the windows 2000 resource kit that could do this either
>
> tx again
> stephen

Try this. Substitute dtDate and strSearchFolder for your need.

http://yimin.blogspot.com/2005/05/wmi-script-to-find-files-last-accessed.html

Yimin Wei

'script begin --------------
dtDate = "5/2/2005"
strSearchFolder = "C:\Windows"

Set objFSO = CreateObject("Scripting.FileSystemObject")
WScript.Echo "File(s) last accessed on: " & dtDate & " in: " &
strSearchFolder
EnumAndCheckFiles objFSO.GetFolder(strSearchFolder), dtDate

Sub EnumAndCheckFiles(objFolder, dtDate)
     Set objFiles = objFolder.Files
     For Each objFile in objFiles
    CheckFile objFile, dtDate
     Next
     For Each objSubfolder in objFolder.SubFolders
         EnumAndCheckFiles objSubfolder, dtDate
     Next
End Sub

Sub CheckFile(objFile, dtDate)
     If DateDiff("d", objFile.DateLastAccessed, dtDate) = 0 Then
         WScript.Echo objFile.Path
     End if
End Sub
'script end -----------------

AddThis Social Bookmark Button