The directory with the following files is specified
image1.txt
image2.txt
image3.txt
I want to get the oldest file (let the files be sorted by data, first the old date):
dir /b /od c:\test\image?.txt | findstr ^1
This works great when entering manually in cmd.exe. Now (in a script package) I want to put the output of this command in a variable. How can i do this? Thank!
Update:
I wonder if there is a direct path without using a loop?
source
share