Branch on whether a file/folder exists in RunMacro
RunMacro RunnerRunMacro 3.5+
The IF File Exists command checks whether a path exists (a file, a folder, or a folder that contains files), then branches: true jumps to IF, false to ELSE.
Dialog & quick setup

- Add a Flow › IF File Exists command.
- Enter the path (variables and
*allowed). - To only test whether a folder contains files, tick "Only check whether a folder has files" (default ON — it hides the mode picker).
- If you untick it, choose the mode in the dropdown: File / Folder / File or Folder.
- Set IF/ELSE labels. Save.
Options reference
Modes & when to use
RunMacro Runner
Best for
- Only proceed when a data file is present (e.g. a download).
- Check a folder for new files to batch-process.
- Skip a step if the output file already exists.
Use an alternative when
- Do not use a one-time existence check to wait for a file that is still downloading or being written.
Before you run
- Add IF File Exists to the macro.
- Prepare the data or target that IF File Exists will use.
Example workflow
Example: process only when a download exists
- IF File Exists, path
C:\Downloads, tick "Only check whether a folder has files". - IF label =
has_filefor the processing steps. - ELSE =
waitto wait or exit.
Expected result: After execution, IF File Exists completes the described action and makes its result available to the next step.
Tips & limitations
Use
* for pattern checks, e.g. *.csv to catch any new CSV file.- Existence does not prove a file is complete or readable; wildcards can overmatch and network paths can return transient results.
Applies to RunMacro 3.5+ · RunMacro Runner · Windows 10/11
