-
Notifications
You must be signed in to change notification settings - Fork 11
FileSearch
Homes32 edited this page Jan 6, 2024
·
1 revision
Search for a file and return it's full path if it exists. If the file cannot be found an empty string is returned.
FileSearch,<Directory>,<File>
Argument | Description |
---|---|
Directory | The directory to search recursively for the specified file. |
Filter | The name of the file including it's extension to search for. (Ex. MyProgram.exe). Wildcards are supported. |
Variable | Description |
---|---|
#r | One of the following: |
Success - A pipe separated list containing the full path(s) to the file. | |
Fail (File not found) - An Empty String |
Use List,Get
to read the value(s) returned and List,Count
to get the number of paths returned.
Search for a file called Resources.dll and return the first path found.
FileSearch,"%ProjectTemp%\%ProgramFolder%","Resources.dll"
If,#r,Equal,"",Halt,"Failed to find [Resources.dll]: The code returned was [#r]."
Else,List,Get,#r,1,%ResPath%