How to obtain a list of all files recursively

The “List of files” action scans only up to 5 levels of nested folders. For cases, when it’s required to obtain a list of files recursively for a deeper folder hierarchy, the “Run program” action can be used to run a respective Windows shell command. For instance

@echo off & for /f "tokens=*" %a in ('dir /s /b *.pdf') do echo %~fa %~za

would scan all subfolders recursively and produce a list of all PFD files and their sizes.

Below is a sample project that would do it for any path and any file mask.

all-files.morph (2.2 KB)

1 Like

After a bit of research, the example has been refined - the Windows shell command is edited to exclude file size.

@echo off & for /f "tokens=*" %a in ('dir /s /b *.pdf') do echo %~fa

It eliminates the need for using an EasyMorph expression to remove file size. Here is the updated example.

all-files.morph (1.8 KB)