Skip to content

File_FindFile

Find the paths containing the specified file

File_FindFile(sFileName, sStartDirectory, bIncludeSubDirectories) As Boolean

File name to search for, without a path. Wildcards aren’t supported. The comparison isn’t case-sensitive.

Directory to start search within

Set to TRUE if sub folders should be included in the search. In the current version of the library, this parameter has no effect: the search always includes all subfolders.

The full path of each file found, for example C:\Temp\Logs\CapaInstaller.txt, is stored in gaValue. The last element of gaValue is always empty, so the number of files found is UBound(gaValue). The function returns True also when no files are found.

The search covers the subfolders of sStartDirectory, at all levels. A file placed directly in sStartDirectory isn’t found. To check that folder, use File_ExistFile.

If bStatus Then bStatus = File_FindFile("CapaInstaller.txt", "C:\", True)
If bStatus Then
For index = 0 To UBound(gaValue) - 1
bStatus = Job_WriteLog("Custom", "The file was found: " & gaValue(index), bStatus, True)
Next
End If

Scripting Guidelines

File_CreateEmptyFile File_CreateDirectory File_DelTree File_DelFile File_ExistDir Constants Package Property Variables