Skip to content

Rename Command: rename

The Rename command renames a specified file within an automation workflow. It helps organize files, standardize naming conventions, and improve file management without altering the file’s content or location.

Example: Suppose you want to rename a file named Draft.docx in the C:\Documents folder to FinalReport.docx.

Steps to configure:

  1. Select Set a Variable Value from the Action dropdown.
  2. Enter a variable name in Element Key (e.g., RenameStatus). This variable will store the result of the rename operation (True or False).
  3. Click on Form, select Functions, and choose File handler Functions.
  4. In the Cmd field, select Rename and provide:
    • File: Specify the path of the file you want to rename (e.g., C:\Documents\Draft.docx).
    • FileAfterRename: Enter the new name of the file (e.g., FinalReport.docx).
scrn-rename-command-tabular-view
Tabular View
scrn-rename-command-card-view
Card View

Outcome on execution:

  • Success: The file is renamed successfully, and the command returns true in the specified variable.
  • Failure: If the file cannot be renamed (e.g., it doesn’t exist or is in use), the command returns false.
  • This variable can be used in later steps of your automation process to reference the stored information using the syntax ${VariableName} (e.g., ${RenameStatus}).

Back To Top