PantZ4 Posted November 1, 2006 Posted November 1, 2006 (edited) $search = FileFindFirstFile("J:\Dokumenter\"&"*.doc") As you maybe can see I wanna to search for .doc files only in J:\Dokumenter. But it wont work . How do I do that? Thank you Edited November 1, 2006 by Mr. Zero
PantZ4 Posted November 1, 2006 Author Posted November 1, 2006 see _FileListTo Array() in help 8)How? I have tryed, follow the help file,: #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray("J:\Dokumenter\","*.doc") If (Not IsArray($FileList)) and (@Error=1) Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf _ArrayDisplay($FileList,"$FileList") And the help file says; lists files and\or folders in a specified path (Similar to using Dir with the /B Switch) #include <File.au3> _FileListToArray($sPath [, $sFilter [, $iFlag]]) Parameters $sPath Path to generate filelist for. $sFilter Optional the filter to use, default is *. Search the Autoit3 helpfile for the word "WildCards" For details. $iFlag Optional: specifies wheather to return files folders or both $iFlag=0(Default) Return both files and folders $iFlag=1 Return files only $iFlag=2 Return Folders only Thanks
lcgreenwald Posted November 1, 2006 Posted November 1, 2006 Try something like this: $search = FileFindFirstFile("J:\Dokumenter\*.doc") While 1 $file = FileFindNextFile($search) If @error = 1 Then Exit MsgBox(0, "DOC file Found", $file) WEnd
lcgreenwald Posted November 1, 2006 Posted November 1, 2006 $search = FileFindFirstFile("J:\Dokumenter\*.doc") If $search = -1 Then MsgBox(0, "Error", "No files matched the search pattern") Else While $search <> -1 $file = FileFindNextFile($search) If @error = 1 Then ExitLoop MsgBox(0, "DOC file Found", $file) WEnd EndIf
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now