IfExist / IfNotExist
检查文件或文件夹是否存在.
过时的: 不推荐在新脚本中使用这些命令. 请使用 FileExist 函数代替.
IfExist, FilePattern
IfNotExist, FilePattern
参数
  - FilePattern
- 需检查的路径, 文件名或文件模式. 如果未指定绝对路径, 则假定 FilePattern 在 %A_WorkingDir% 中. 
FileExist(), 区块, Else, 文件循环
示例
 如果 D 盘确实存在, 会显示一个消息框.
IfExist, D:\
    MsgBox, The drive exists.
 
 如果目录中至少有一个文本文件存在, 会显示一个消息框.
IfExist, D:\Docs\*.txt
    MsgBox, At least one .txt file exists.
 
 如果文件 不 存在, 会显示一个消息框.
IfNotExist, C:\Temp\FlagFile.txt
    MsgBox, The target file does not exist.