stu22180 Posted February 22, 2008 Share Posted February 22, 2008 I would like write an autoit script to search thought a directory tree for all the files that were modified in a given date range and count this numbers of files. Right now my mine is drawing big blank can anyone help me? Thanks Stu Link to comment Share on other sites More sharing options...
weaponx Posted February 22, 2008 Share Posted February 22, 2008 You will first need a recursive _FileListToArray function. You will gather an array of all files first, then populate a secondary array after looping through said list.Find a decent _FileListToArray function here:http://www.autoitscript.com/forum/index.ph...c=58558&hl=#include <array.au3> #Include <Date.au3> #Include "RecursiveFileSearch.au3" $Array = RecursiveFileSearch(@MyDocumentsDir, "","", 1, true) ;_ArrayDisplay($Array) Dim $NewArray[$Array[0]] $nextElement = 1 For $X = 1 to $Array[0] $timeArray = FileGetTime($Array[$X],0,0) $timeString = $timeArray[0] & "/" & $timeArray[1] & "/" & $timeArray[2] & " " & $timeArray[3] & ":" & $timeArray[4] & ":" & $timeArray[5] ;Add files to new array between December 1, 2007 and December 31, 2007 If _DateDiff( 'd',"2007/12/01 00:00:00",$timeString) > 0 AND _DateDiff( 'd',"2007/12/31",$timeString) < 0 Then $NewArray[$nextElement] = $Array[$X] $NewArray[0] += 1 $nextElement += 1 EndIf Next Redim $NewArray[$nextElement] _ArrayDisplay($NewArray) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now