And how to capture the file you just created? Your application should know the filename if it created the file. You cannot rely on the current date and time because of possible delays in processing.
Above code renames everything which matches to the given filename mask. If you would like to rename just files not renamed already then you have to use additional parameter in ADIR() call and test each filename.