Below is part of the Scan Tool relating to the File Scan using FAFOpen. As this is only part of the Source Code it may reference Variable etc outside the code posted:
; Initialize flags for readability
fsHidden = 1 ; Include hidden files
fsSystem = 2 ; Include system files
fsRecurse = 16 ; Look in sub directories
File = FileOpen(DatFile, "WRITE")
Drives = DiskScan(2)
For A = 1 to ItemCount(Drives, @Tab)
DriveID = ItemExtract(A, Drives, @Tab)
; Open a search handle
fsHandle = fafOpen("%DriveID%\", "*.*", fsHidden|fsSystem|fsRecurse)
LastFilePath = ""
; Perform the search
While @TRUE
sFound = fafFind(fsHandle)
If sFound == "" Then Break
FPath = FilePAth(SFound)
If LastFilePath <> FPath Then
FileWrite(File, "")
FileWrite(File, "[%FPath%]")
LastFilePath = FPath
EndIf
If FileExist(SFound) Then
FName = FileRoot(SFound)
Extension = StrUpper(FileExtension(SFound))
FileName = StrCat(FName, ".", Extension)
If Extension == "EXE" || Extension == "COM" || Extension == "DLL" Then
FVersion = FileVerInfo(SFound, "", "FileVersion")
Else
FVersion = ""
Endif
Details = StrCat(FileName, "=F|", FileSizeEx(SFound, 1), "|", FileYMDHMS(SFound), "|", FVersion)
EndIf
FileWrite(File, Details)
EndWhile
FafClose(fsHandle)
Next A
FileClose(File)