BAT script: finding the latest files in the directory
Echo off
Setlocal enabledelayedexpansion
Directory where the rem settings file is located
Set src_dir=D:\ test\ newtest\
Rem filename is used to store the target file name
Set filename= ""
Cd / d src_dir%
For / f% an in ('dir / Omurd / tc / b.') Do (
Echo file complete information:% a
Set filename=%%~na%%~xa
Echo file name:! filename, latest creation time:%% ~ ta
Goto end
)
: end