in reply to Re: Batch file renaming - on identical name, keep only most recent file, based on dates
in thread Batch file renaming - on identical name, keep only most recent file, based on dates

-M _

I think it's very much worth noting that this relies on the file's modification time being the same as the timestamp in the filename, which is IMHO is pretty risky. For example, if the timestamp in the filename is the time a log file was started, its modification time may very well be much later than that. Or, if the files were copied into this directory from somewhere else, the modification times may be completely unreliable.

  • Comment on Re^2: Batch file renaming - on identical name, keep only most recent file, based on dates
  • Download Code

Replies are listed 'Best First'.
Re^3: Batch file renaming - on identical name, keep only most recent file, based on dates
by soonix (Chancellor) on Nov 07, 2019 at 19:10 UTC
    ++, but the timestamp in the original file name doesn't necessarily refer to creation/update of the corresponding file, either.