DocsCodeDelete Files in Folder

Delete all files in a folder in RunMacro

RunMacro RunnerRunMacro 3.5+

The Delete Files in Folder command removes all files (leaving subfolders) in a folder you choose.

Dialog & quick setup

RunMacro Delete Files in Folder command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the Delete Files in Folder command in RunMacro.
  1. Add a Code › Delete Files in Folder command.
  2. Choose the folder path.
  3. Save. On run, all files in the folder are deleted.

Options reference

Folder path

The folder to clean. Only direct files are removed, not subfolders.

Modes & when to use

RunMacro Runner

Best for

  • Clean a downloads folder before each run.
  • Remove temp files after processing.
  • Clear a results folder to avoid mixing old data.

Use an alternative when

  • Do not use it before verifying the path/backups or when deleting one explicit file is safer.
Before you run
  • Add Delete Files in Folder to the macro.
  • Prepare the data or target that Delete Files in Folder will use.

Example workflow

Example: clean the images folder before new downloads

  1. Delete Files in Folder C:\Images.
  2. Then use Download Avatar/Images to fetch a fresh set.
Expected result: After execution, Delete Files in Folder completes the described action and makes its result available to the next step.

Tips & limitations

Deletion cannot be undone — double-check the path before running.
  • Deletion is destructive under current patterns/permissions, has no undo, and locked files can leave partial results.

Applies to RunMacro 3.5+ · RunMacro Runner · Windows 10/11

RunMacro robot

Robots do the work. Your time is yours.

Create a robot in minutes, no coding needed. Reliable execution, remote management, transparent costs — and you always stay in control.