|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
find files last accessed on a certain date
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 ste o'c wrote:
> hi guys Try this. Substitute dtDate and strSearchFolder for your need.> 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 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 ----------------- |
|||||||||||||||||||||||