Make sure you #Include Date.au3, WinAPI.au3, and Array.au3 in your script as well.
Func _CompareFileTimeEx($hSource, $hDestination, $iMethod) ; Parameters ....: $hSource - Full path to the first file ; $hDestination - Full path to the second file ; $iMethod - 0 The date and time the file was created ; 1 The date and time the file was accessed ; 2 The date and time the file was modified ; Return values .: -1 First file time is earlier than second file time ; 0 First file time is equal to second file time ; 1 First file time is later than second file time ; Author ........: Ian Maxwell (llewxam @ AutoIt forum) Local $hCurrent[2] = [$hSource, $hDestination], $tPointer[2] = ["", ""] For $iPointerCount = 0 To 1 $hFile = _WinAPI_CreateFile($hCurrent[$iPointerCount], 2) $aTime = _Date_Time_GetFileTime($hFile) _WinAPI_CloseHandle($hFile) $aDate = _Date_Time_FileTimeToStr($aTime[$iMethod]) $tFile = _Date_Time_EncodeFileTime(StringMid($aDate, 1, 2), StringMid($aDate, 4, 2), StringMid($aDate, 7, 4), StringMid($aDate, 12, 2), StringMid($aDate, 15, 2), StringMid($aDate, 18, 2)) $aDOS = _Date_Time_FileTimeToDOSDateTime(DllStructGetPtr($tFile)) $tFileTime = _Date_Time_DOSDateTimeToFileTime("0x" & Hex($aDOS[0], 4), "0x" & Hex($aDOS[1], 4)) $tPointer[$iPointerCount] = DllStructGetPtr($tFileTime) Next Return _Date_Time_CompareFileTime($tPointer[0], $tPointer[1]) EndFunc ;==>_CompareFileTimeEx
Enjoy
Ian





