Open the oldest pdf



How do I open the oldest pdf in a folder and get its name?


You can search for the properties of files and use that to determine which is the oldest…

Use something like the following


Hey @mario

You can try this:


FileSystemInfo fileInfo = new DirectoryInfo(directoryPath).GetFileSystemInfos().OrderByDescending(function(fi) fi.CreationTime).First()



Thanks guys. FileSystemInfo fileInfo is my left side in action assign? So can I rename it for example to FileName? What kind of variable should be that?


Yes create a variable with name “fileinfo” with a data type System.IO.FileSystemInfo then assign the above thing and replace directory path with your directory path.


thanks a lot