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

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.
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
- Add a File › Delete File or Folder command.
- Enter the path to delete.
- Choose the delete mode: Recycle Bin or Permanent.
- (Optional) Restrict the kind (file/folder), enable recursive for non-empty folders, and skip when missing. Save.
Every option explained
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
- 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