home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 February / PCWorld_2006-02_cd.bin / software / vyzkuste / triky / triky.exe / autoit-v3-setup.exe / Examples / FileFindNextFile.au3 < prev    next >
Text File  |  2004-09-22  |  410b  |  19 lines

  1. ; Shows the filenames of all files in the current directory
  2. $search = FileFindFirstFile("*.*")  
  3.  
  4. ; Check if the search was successful
  5. If $search = -1 Then
  6.     MsgBox(0, "Error", "No files/directories matched the search pattern")
  7.     Exit
  8. EndIf
  9.  
  10. While 1
  11.     $file = FileFindNextFile($search) 
  12.     If @error Then ExitLoop
  13.     
  14.     MsgBox(4096, "File:", $file)
  15. WEnd
  16.  
  17. ; Close the search handle
  18. FileClose($search)
  19.