Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 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)
  12. Local $NextFile
  13. Local $aFiles[1] = [0]
  14. Local $FirstFile = FileFindFirstFile($Path & "\*.*")
  15. While True
  16. $NextFile = FileFindNextFile($FirstFile)
  17. If @error Then ExitLoop
  18. $aFiles[0] += 1
  19. ReDim $aFiles[$aFiles[0]+1]
  20. $aFiles[$aFiles[0]] = $NextFile
  21. WEnd
  22. Return $aFiles
  23. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement