
Ok any autoit experts out there need to write a script that will look at files in directory find last file to be changed and place it in variable...
Anyideas
cheers
Russ
explain exactly what you are after and i will be happy to write a script for you have done about 30 now from installing software to network searches for .mp3 and jpegs the first bit is easy do you want to select what variable or browse to ?? also is the directory always the same or will you browse to it
have made a start but i need some more details ??

Hi idea is the backup solution currently produces logs backup1.log, backup2.log all way to backup9.log and rotates itself so finds oldest and replaces with the new log.
Right need a script that will find latest aka last changed file and email it to me (this can be either via script or by the script calling blat.
Russ
That sounds like you are looking up the most recent NTBackup log Russ.
If that's the case, there might be 2 other solutions.
1 - Modify the NTBACKUP command line to place the log file in a place of your choosing so that your script can pick it up directly
or
2 - Use BackupAssist, which will analyze the log for you and email you a lovely looking HTML report.
Funnily enough, I have written something to do just what you ask I now remember. I never used it though, so thorough testing is advised!
Code:Func GetLatestFile($DirPath, $FileSpec) ; Shows the filenames of all files in the current directory. $search = FileFindFirstFile($DirPath & "\" & $FileSpec) $LatestFile = "" $LatestTime = 0 ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Else While 1 $file = FileFindNextFile($search) if @error then ExitLoop if StringInStr(FileGetAttrib($DirPath & "\" & $file), "D") > 0 Then ; Skip directories Else $FileTime = FileGetTime($DirPath & "\" & $file,0,1) if $FileTime > $LatestTime Then $LatestFile = $File $LatestTime = $FileTime EndIf EndIf WEnd EndIf

For various reasons I don't want to do number one as want to leave current way it is setup.Originally Posted by ajbritton
Will have look at script and any others sent my way..
Russ
well give me a shout if you want another one and i will finish coding it.

go one alonebfg always useful have to have few different scripts to choose from...
Russ
There are currently 1 users browsing this thread. (0 members and 1 guests)