Delete a file or folder automatically in RunMacro
Desktop ModeBrowser ModeRunMacro 3.5+
Delete File or Folder removes a path to the Recycle Bin or permanently, with an optional kind restriction and skip-when-missing.
Dialog & quick setup

- 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.
Options reference
Modes & when to use
Desktop Mode
Operates on the local file system.
Browser Mode
Best for
- Clean temp files after processing.
- Remove old output before creating new.
- Drop a folder that is no longer needed.
Use an alternative when
- You only want to delete files inside a folder by pattern — consider Delete Files.
Before you run
- Delete permission at that location.
- Recycle Bin mode needs the send2trash package.
Example workflow
Expected result: The path is deleted per the chosen mode; the output variable holds the deleted path.
Tips & limitations
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.
- Permanent delete cannot be undone.
- Non-empty folders need recursive enabled (for permanent delete).
Applies to RunMacro 3.5+ · Desktop Mode & Browser Mode · Windows 10/11
