> ## 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.

# If 文件存在

## 指令说明

**描述：** 判断目标文件是否存在。

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/54VOmvcVz9x5vq70/helpcenter/commands/condition/images/if-file-01-panel.png?fit=max&auto=format&n=54VOmvcVz9x5vq70&q=85&s=dc1f940f14c126a77f6df575ed93ae94" alt="If 文件存在指令参数面板" width="660" height="326" data-path="helpcenter/commands/condition/images/if-file-01-panel.png" />

    | 参数       | 说明                                    |
    | -------- | ------------------------------------- |
    | **文件路径** | 输入或选择目标文件的绝对路径，从盘符开始，如：`D:\八爪鱼文档.txt` |
    | **文件状态** | 存在 / 不存在                              |
  </Tab>

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

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/54VOmvcVz9x5vq70/helpcenter/commands/condition/images/if-file-02.png?fit=max&auto=format&n=54VOmvcVz9x5vq70&q=85&s=8d02af9e0204b2b85fbd35a43643fcc4" alt="If 文件存在 - 流程搭建" width="1187" height="417" data-path="helpcenter/commands/condition/images/if-file-02.png" />

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

使用【If 文件存在】指令判断文件路径是否存在

若存在则执行【打印日志】指令打印 "文件存在"

否则执行【打印日志】指令打印 "文件不存在"

### 效果展示

<img src="https://mintcdn.com/bazhuayu-rpa-docs/54VOmvcVz9x5vq70/helpcenter/commands/condition/images/if-file-03.png?fit=max&auto=format&n=54VOmvcVz9x5vq70&q=85&s=60c1e7b0b1f2b9a14ecea2bd2c103ccc" alt="If 文件存在 - 效果展示" width="1205" height="365" data-path="helpcenter/commands/condition/images/if-file-03.png" />

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