> ## Documentation Index
> Fetch the complete documentation index at: https://rpa.bazhuayu.com/helpcenter/llms.txt
> Use this file to discover all available pages before exploring further.

# 文件重命名

## 指令说明

**描述：** 修改一个文件的名称

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/y7Z2TvwRJJef-uiI/helpcenter/commands/os/images/renamefilecommand-10.jpg?fit=max&auto=format&n=y7Z2TvwRJJef-uiI&q=85&s=2b3b610f863799d82d75d5e042ca851b" alt="文件重命名指令参数面板" width="643" height="459" data-path="helpcenter/commands/os/images/renamefilecommand-10.jpg" />

    | 参数          | 说明                                 |
    | ----------- | ---------------------------------- |
    | **要重命名的文件** | 选择需要重命名的文件                         |
    | **文件新名称**   | 输入文件的新名称，若新名称中不包含扩展名，则自动保留原文件的扩展名  |
    | **当文件存在时**  | 当文件夹中已经存在同名的文件时，不执行重命名操作或覆盖原有的同名文件 |
    | **结果保存至**   | 将修改后的文件的完整路径保存至变量，若不存在则自动创建        |
  </Tab>

  <Tab title="高级">
    本指令暂无高级参数。
  </Tab>
</Tabs>

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/y7Z2TvwRJJef-uiI/helpcenter/commands/os/images/renamefilecommand-01.png?fit=max&auto=format&n=y7Z2TvwRJJef-uiI&q=85&s=68f79115f0095e616caa25c00e2676f2" alt="文件重命名使用示例" width="842" height="163" data-path="helpcenter/commands/os/images/renamefilecommand-01.png" />

**该流程执行逻辑：**

使用【文件重命名】命令获取 D:\新建.xlsx 文件重命名为 “重命名测试” ，并将结果保存到变量：新的文件路径

### 效果展示

<img src="https://mintcdn.com/bazhuayu-rpa-docs/y7Z2TvwRJJef-uiI/helpcenter/commands/os/images/renamefilecommand-02.png?fit=max&auto=format&n=y7Z2TvwRJJef-uiI&q=85&s=8ca7f268eb3cbbc8c7634bf5bacaedd5" alt="文件重命名效果展示" width="881" height="192" data-path="helpcenter/commands/os/images/renamefilecommand-02.png" />

<Info>
  使用指令过程中遇到问题？前往 [八爪鱼RPA 开发者社区问答板块](https://rpa.bazhuayu.com/community/questions) 提问，获取官方与社区帮助。
</Info>
