KeyRoutines
StepFreefile.list

List files in a folder by name, age or size on Windows

List files collects the files in a folder that match your filters and gives you the list to work with. It is usually paired with For each so a routine can deal with many files one at a time.

How it works

  • Pick a folder and a name pattern such as *.pdf, or several separated by semicolons like *.jpg;*.png.
  • Filter by how long ago items last changed, and in the advanced options by size, subfolders and whether to include folders as well as files.
  • Sort by name, newest, oldest, largest or smallest, and cap the list with a limit (1000 by default); an output tells you when the list was cut short.
  • Each item comes with its path, name, extension, folder, size and dates, plus a total count.
  • Hidden files, system files and downloads still in progress are left out.

Routines that use it

Desktop clean-up

List Desktop files older than 7 days, then For each one Move or copy file puts it into an Old Desktop folder.

Count new screenshots

List images in your Screenshots folder changed in the last day and Show banner with the count.

Zip the newest logs

Sort a log folder by newest with a limit of ten, then Zip files packs just those for sending.

Settings

SettingWhat it does
FolderThe folder to look in.
PatternWhich names, like *.pdf. Separate several with ; (*.jpg;*.png).
Older thanOnly items last changed at least this long ago.
Newer thanadvancedOnly items last changed at most this long ago.
Min sizeadvancedAt least this many bytes.
Max sizeadvancedAt most this many bytes.
Include subfoldersadvancedAlso look inside subfolders.
Include foldersadvancedList folders too, not only files.
SortadvancedThe order of the list.
LimitadvancedAt most this many items.

Good to know

  • The list stops at the limit you set, 1000 items by default.

Questions

How do I find files older than a certain number of days?
Set the folder in List files and fill in the "older than" filter. Only items last changed at least that long ago end up in the list.
Can it search subfolders?
Yes, there is an advanced option to also look inside subfolders. You can also choose to include folders in the results.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.