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 Copy File or Folder
📄 File

Copy a file or folder automatically in RunMacro

Copy File or Folder copies source to destination with a conflict policy, and saves the resulting path to a variable.

Prerequisites

  • Source exists; read access to source and write access to destination.

Supported modes

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

What it does

The Copy File or Folder command copies from a source path to a destination path. For folders, the whole subtree is copied. You choose how to handle an existing destination and can preserve file metadata.

When to use it

  • Back up a file before processing.
  • Duplicate a template to edit.
  • Collect files into a destination folder.

When not to use it

  • You want to move (not keep the original) — use Move File or Folder.

Configuration steps

  1. Add a File › Copy File or Folder command.
  2. Enter the source path and destination path.
  3. Choose a conflict policy: error, skip, overwrite, or unique name.
  4. (Optional) Enable preserve metadata for files. Save.

Every option explained

Source path

The file or folder to copy.

Destination path

Where to copy to. If the destination is a folder, the item is placed inside using its original name.

Conflict policy

error, skip, overwrite, or unique_name (auto-append a number to avoid clashing).

Preserve metadata

For files: keep timestamps and attributes when copying.

Output variable

Variable that receives the final destination path (default last_copied_path).

Expected result

A copy appears at the destination; the output variable holds the destination path.

Real example

Example: back up a config file

  1. Copy: source config.json, destination backup\config.json, conflict = overwrite.
  2. Use {last_copied_path} to confirm.

Limitations and failure cases

  • Cannot copy a folder into itself.
  • Large folders can take time.

Tips & common mistakes

With overwrite, the old destination is replaced. Use "unique name" to keep both.

Verification details

  • commands/filesystem.py
RunMacro robot

Ready to automate smarter?

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