List files and folders in RunMacro
Desktop ModeBrowser ModeRunMacro 3.5+
List Files and Folders scans a folder by pattern, filters by kind, optionally recurses, then saves the list and count to variables.
Dialog & quick setup

- Add a File › List Files and Folders command.
- Enter the folder and a pattern (default
*= everything). - Choose the kind (file/folder/any) and whether to recurse.
- Choose the result format (one per line or JSON) and return mode (full path / name only / relative path).
- (Optional) Rename the list and count variables. Save.
Options reference
Modes & when to use
Desktop Mode
Operates on the local file system.
Browser Mode
Best for
- Get a file list to loop over and process each one.
- Count files matching a pattern.
- Walk a folder tree to collect data.
Use an alternative when
- You only need to check if one file exists — use IF File Exists.
Before you run
- The folder exists and is readable.
Example workflow
Example: loop over every PNG
- List: images folder, pattern
*.png, kind = file, return = full path. - Feed
{directory_entries}into a Loop to process each image.
Expected result: The list variable holds the matching items (sorted); the count variable holds the total.
Tips & limitations
Use the one-per-line format for easy looping; use JSON when another step needs to read an array.
- Very large listings can use memory when stored in a single variable.
Applies to RunMacro 3.5+ · Desktop Mode & Browser Mode · Windows 10/11
