How to identify file based on timestamp in batch script

Prasanna - Aug 5, 2020 at 03:29 PM

I have a list of csv files with date and time appended like "Account_data_yyyymmdd.csv" which are added daily along with its timestamp to source dir .I have to identify latest file ie.'Account_data_2020_08_05.csv' and set the value in variable . so i can pass it as argument

Files in source dir

I have to find the recently placed file based on its timestamp & pass it as input for calling another batch process. Highlighted text is the argument to batch file.How to find latest file based on its timestamp and pass it as argument for

echo "start"
call process.bat "C:\CSVDataLod" AccntDataloadprocess ***"\SourceDir\ Account_data_%year%_%month%_%date%.csv"***

System Configuration: Windows / Chrome 84.0.4147.105