---
schema_version: "1"
id: 863487b6709947d92c5504f6c01dd57f8c07f7fd7976e2e2db68485aa4dd24eb
title: File Operations
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/rpa-builder/6.6/toolbox-file-operations.md
canonical_url: https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 935a55b5e441b485f71e846376cae0a3728ecc2ae2de45d7e303ab2db234c405
description: MuleSoft Documentation Site
release: "6.6"
latest: false
---
---
product: RPA Builder
version: 6.6
---

# File Operations

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

File Operations enable you to interact with the file system where your automation is running.

- [Copy File](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-copy-file)

  This Action Step copies a file from one directory to another.

- [Create File](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-create-file)

  This Action Step creates an empty file at the specified path.

- [Delete File](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-delete-file)

  This Action Step deletes a file located at the specified path.

- [Extract Images from PDF File](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-extract-images-from-pdf-file)

  This Action Step enables you to extract images from a PDF file.

- [File Check](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-file-check)

  This Action Step enables you to check whether a file exists or not.

- [Get File Info](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-get-file-info)

  This Action Step fetches information about a file at the specified path.

- [Iterate over Files](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-iterate-over-files)

  This Action Step performs various Action Steps on a specified number of files.

- [Move File](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-move-file)

  This Action Step moves a file from one directory to another.

- [Read from Text File](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-read-from-text-file)

  This Action Step enables you to read from a text file and use the Read Mode to specify which part
  of the file is to be read.

- [Read PDF File](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-read-pdf-file)

  With the Read PDF File Action Step, you can read text from a PDF file.

- [Rename File](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-rename-file)

  This Action Step renames a file.

- [Write to Text File](https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-write-to-text-file)

  Write to Text File writes text to a text file.

## Common Settings and Properties

The following settings and properties apply to all the File Operations Action Steps:

- **Action Step Settings**

  Specify path information for all Action Steps of the type File Operations in Settings. To access
  the Settings configuration panel, click (![The Settings icon](/mulesoft/current/en-us/rpa-builder/6.6/_images/settings-icon.png)
  **Settings**) in the Workflow Initialization block.

- **Path checking**

  The paths calculated at runtime for File Operations are checked against the list of allowed paths
  configured in the **Allow File Operation Action Steps only in following paths** option inside
  **Workflow Settings** → **File Operation Settings**.

- **Path / file name / invalid characters**

  RPA Builder manages the path and file name separately and makes them available to other operations
  as the Outbound Variables **File Name** and **Directory Path**. Action Steps cannot interpret
  wildcards in the form of `?` or `*`.

  Use unique file names at all times. If the path or file name contains invalid characters, the
  Action Step goes into an error state (this does not apply to the **File name** in the **Iterate
  over Files Action Step**). The Iterate over Files Action Step iterates over the result of a
  wildcard operation in the form of an Action Block.

  The following characters are invalid:

  <table><colgroup><col> <col></colgroup><thead><tr><th>Symbol</th><th>Explanation</th></tr></thead><tbody><tr><td><p><code>&lt;</code></p></td><td><p>Less than sign</p></td></tr><tr><td><p><code>&gt;</code></p></td><td><p>Greater than sign</p></td></tr><tr><td><p><code>:</code></p></td><td><p>Colon</p></td></tr><tr><td><p><code>"</code></p></td><td><p>Double quotes</p></td></tr><tr><td><p><code>/</code></p></td><td><p>Forward slash</p></td></tr><tr><td><p><code>\</code></p></td><td><p>Back slash</p></td></tr><tr><td><p><code>|</code></p></td><td><p>Vertical bar</p></td></tr><tr><td><p><code>?</code></p></td><td><p>Question mark</p></td></tr><tr><td><p><code>*</code></p></td><td><p>Asterisk</p></td></tr></tbody></table>

- **Timeout**

  If the desired File Operation is not completed successfully within this time, the Action Step goes
  into an error state.

- **Insert environment variable**

  The **Insert Environment Variable** drop-down list of all File Operation Action Steps contains a
  predefined list of Windows environment variables. Use these in the Directory Path field to define
  a variable path to a file within the relevant Action Steps. The variable will be inserted at the
  current location of the cursor. The standard environment variables and variables defined by the
  user in RPA Builder are available.

  The environment variables contain paths to specific folders. The default installation location for
  Internet Explorer, for example, is `C:\Program Files\Internet Explorer\` or
  `C:\Program Files x86\Internet Explorer\`. The path may vary if the operating system was installed
  on a different drive or in a different language.

  The following list contains the key environment variables:

  - **%ALLUSERSPROFILE%**

    The All Users profile folder

  - **%APPDATA%**

    The folder for the Application Data of the user who is presently logged in

  - **%COMPUTERNAME%**

    System name

  - **%ProgramFiles%**

    The folder for Programs

  - **%SystemRoot%**

    The system root folder, for example `C:\Windows`

  - **%SystemDrive%**

    The system root drive, for example `C:\`

  - **%USERPROFILE%**

    The profile folder for the user who is presently logged in

- **Insert Script Variable**

  The **Insert Script Variable** drop-down list of all File Operation Action Steps contains a
  predefined list of script variables. Use these in the Directory Path field to define a variable
  path to a file within the relevant Action Steps. The variable is inserted at the current location
  of the cursor.

  The following RPA Builder script variables are available:

  - **Computer Name**

    This script variable `{@ComputerName}` inserts the name of the computer on which the Action
    Script is presently running.

  - **Local Host Name**

    This script variable `{$HostName}` inserts the name of the host on which the Action Script is
    presently running. The host name may differ from the computer name if, for example, several
    virtual machines are running on one host.

  - **Login User Name**

    This script variable `{$UserName}` inserts the name of the user who is logged in.

  - **New Line**

    This script variable `{@CRLF}` creates a line break. This script variable works only in the
    Action Step Write to Text File.

  - **Script Run Directory**

    The script variable `{@ScriptDir}` returns the directory containing the Workflow without a
    trailing backslash.

  - **Tabulator**

    This script variable `{@TAB}` inserts a tab stop. This script variable works only in the Action
    Step Write to Text File.

- **User privileges**

  For all Action Steps of the type File Operations, the file operations are successful only if the
  user who is presently logged in has privileges to access the directories and files used.
