Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <Array.au3>
  2.  
  3. $Path = FileSelectFolder("Select a folder","")
  4. If Not @error Then
  5. $aFiles = GetFiles($Path)
  6. _ArrayDisplay($aFiles)
  7. Else
  8. MsgBox(0x10,'Error','Invalid directory.')
  9. EndIf
  10.  
  11. Func GetFiles($Path, $Flag=0)
  12. Local $NextFile, $IsDir
  13. Local $aFiles[1] = [0]
  14. Local $FirstFile = FileFindFirstFile($Path & "\*.*")
  15. While True
  16. $NextFile = FileFindNextFile($FirstFile)
  17. $IsDir = @extended
  18. If @error Then ExitLoop
  19. If $Flag = 1 And $IsDir Then
  20. ContinueLoop
  21. Else
  22. $aFiles[0] += 1
  23. ReDim $aFiles[$aFiles[0]+1]
  24. $aFiles[$aFiles[0]] = $NextFile
  25. EndIf
  26. WEnd
  27. Return $aFiles
  28. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement