Get the App
SLTechnology News&Howtos  ›  Servers  › 

BAT script: finding the latest files in the directory

Shulou Source: shulou.com Published: 2022-06-03 04:42:41 09月10日 Update

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

Tags: File file name directory information location time target script Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Apple Microsoft Redmi Docker