Docs

RunMacro Documentation

Learn RunMacro from basics to advanced.

Everything you need to start and master RunMacro — from basic commands to advanced automation workflows.

RunMacro robot
Docs File Delete File or Folder
🗑 File

Delete a file or folder automatically in RunMacro

Delete File or Folder removes a path to the Recycle Bin or permanently, with an optional kind restriction and skip-when-missing.

Prerequisites

  • Delete permission at that location.
  • Recycle Bin mode needs the send2trash package.

Supported modes

  • Desktop ModeOperates on the local file system.
  • Browser Mode

What it does

The Delete File or Folder command removes a path. You choose the Recycle Bin (recoverable) or permanent delete, restrict to files or folders only, and optionally skip when the path is missing.

When to use it

  • Clean temp files after processing.
  • Remove old output before creating new.
  • Drop a folder that is no longer needed.

When not to use it

  • You only want to delete files inside a folder by pattern — consider Delete Files.

Configuration steps

  1. Add a File › Delete File or Folder command.
  2. Enter the path to delete.
  3. Choose the delete mode: Recycle Bin or Permanent.
  4. (Optional) Restrict the kind (file/folder), enable recursive for non-empty folders, and skip when missing. Save.

Every option explained

Target path

The file or folder to delete. Supports variables.

Delete mode

recycle_bin (recoverable) or permanent (unrecoverable).

Target kind

file, folder, or any — guards against deleting the wrong kind.

Recursive

Allows deleting a non-empty folder (for permanent delete).

Missing OK

If on, does not error when the path is already gone.

Expected result

The path is deleted per the chosen mode; the output variable holds the deleted path.

Real example

Example: safely clean a temp file

  1. Delete: path {temp_file}, mode = Recycle Bin, Missing OK = on.

Limitations and failure cases

  • Permanent delete cannot be undone.
  • Non-empty folders need recursive enabled (for permanent delete).

Tips & common mistakes

Permanent delete is unrecoverable. Prefer the Recycle Bin mode for bulk or still-testing runs.
The Recycle Bin mode needs the send2trash package; if missing, the command errors.

Verification details

  • commands/filesystem.py
RunMacro robot

Ready to automate smarter?

Download RunMacro and start automating your desktop, browser, and business workflows today.