Docs

RunMacro Documentation

Create your first robot, then go further as needed.

Clear step-by-step guides to create, run, and improve robots for repetitive computer work.

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 Mode — Operates 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.

Screenshots & video#

RunMacro Delete File or Folder command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the Delete File or Folder command in RunMacro.

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

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.