RagnaroktA Posted January 25, 2006 Share Posted January 25, 2006 I've searched and came up with nothing... Is there a way to specify the working directory when searching for files of a specific type? Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
MHz Posted January 25, 2006 Share Posted January 25, 2006 Have a look at FileChangeDir() in the helpfile. Or you can specify the path in FileFindFirstFile(). Link to comment Share on other sites More sharing options...
BigDod Posted January 25, 2006 Share Posted January 25, 2006 See example below $search = FileFindFirstFile("d:\autoit\*.au3") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) WEnd FileClose($search) Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
MHz Posted January 25, 2006 Share Posted January 25, 2006 See example below $search = FileFindFirstFile("d:\autoit\*.au3") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) WEnd FileClose($search)Good example. And with FileChangeDir() is: FileChangeDir('d:\autoit') $search = FileFindFirstFile("*.au3") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) WEnd FileClose($search) Link to comment Share on other sites More sharing options...
RagnaroktA Posted January 25, 2006 Author Share Posted January 25, 2006 Good example. And with FileChangeDir() is: FileChangeDir('d:\autoit') $search = FileFindFirstFile("*.au3") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) WEnd FileClose($search) Thanks for the replies all! I had no idea you could specify the path... and I guess I overlooked the FileChangeDir function. Sorry, I'm quite a bit off today. Thanks all! Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
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