johns420 Posted July 12, 2007 Share Posted July 12, 2007 I am trying to write a script that involves finding a file that may have different names but the same file extension. What would be the best way to do this? I need to be able to take the path of the file, file name and extension included, and send it out to a text box. Thanks for the help in advance Link to comment Share on other sites More sharing options...
Jettison Posted July 12, 2007 Share Posted July 12, 2007 Use FileFindFirstFile() and FileFindNextFile(): $bleh = FileFindFirstFile("*.bat") If $bleh = -1 Then MsgBox(0, "Error", "File/folder not found") Exit EndIf While 1 $file = FileFindNextFile($bleh) If @error Then ExitLoop MsgBox(4096, "File:", $file) WEnd ; Close the search handle FileClose($bleh) [font="Impact"]Cats rule, humans drool.[/font] Link to comment Share on other sites More sharing options...
johns420 Posted July 12, 2007 Author Share Posted July 12, 2007 Use FileFindFirstFile() and FileFindNextFile(): $bleh = FileFindFirstFile("*.bat") If $bleh = -1 Then MsgBox(0, "Error", "File/folder not found") Exit EndIf While 1 $file = FileFindNextFile($bleh) If @error Then ExitLoop MsgBox(4096, "File:", $file) WEnd ; Close the search handle FileClose($bleh) Awesome, thanks for the help. 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