Find Top N Newest Files

Returns a list of N files that have the earliest creation date.

Privileges

Normal

Input Parameters

Name Type Required Description
Folder String Yes The path to search for files that satisfy the filter.
Filter String No The filter to be applied to the file names. For example,*.txt
Number of files Number Yes The number of files to return.
Recurse Boolean Yes Indicates that subfolders should be searched.

Output Parameters

Name Type Description
FileList Collection

Each file in the list contains the following members:

  • FileFullName
  • CreationTime

Also use the ForEach object in order to use each collection item's fields. Link the input parameters from the ForEach object to these output parameters.

Result Number

Returns a success value of zero or any value other than zero to indicate failure.

Example Input Parameters

Name Type Required Example
Folder String Yes C:\folder1\folder2
Filter String No *.txt or Name*.txt
Number of files Number Yes 5
Recurse Boolean Yes Indicates that subfolders should be searched.