Skip to content

Instantly share code, notes, and snippets.

@grayatrox
Last active April 8, 2016 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grayatrox/9441281e7025896d5656452523341c0b to your computer and use it in GitHub Desktop.
Save grayatrox/9441281e7025896d5656452523341c0b to your computer and use it in GitHub Desktop.
#SingleInstance, Force
SetBatchLines, -1 ; Make the operation run at maximum speed.
lastFileModified := GetLastModified(A_MyDocuments,"")
FormatTime, OutputVar, %lastFileModified%
msgbox %outputVar%
GetLastModified(file, ByRef _lastModified) {
;msgbox Looping %file%
Loop, Files, %file%*.*, DF
{
if (InStr(FileExist(A_LoopFileFullPath), "D")) {
;msgbox %A_LoopFileName% is a Directory! Should now recurse into %A_LoopFileFullPath%
new_LastModified := GetLastModified(A_LoopFileFullPath "\",_lastModified)
if (new_LastModified > _LastModified){
;msgbox _LastModified changed by recursion
_LastModified := new_LastModified
}
}
Else If (A_LoopFileTimeModified > _LastModified && A_LoopFileTimeModified < A_Now) {
;Msgbox _LastModified changed by file: %A_LoopFileName%
_LastModified := A_LoopFileTimeModified
}
}
Return _LastModified
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment