Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Array.au3>
- $Path = FileSelectFolder("Select a folder","")
- If Not @error Then
- $aFiles = GetFiles($Path)
- _ArrayDisplay($aFiles)
- Else
- MsgBox(0x10,'Error','Invalid directory.')
- EndIf
- Func GetFiles($Path)
- Local $NextFile
- Local $aFiles[1] = [0]
- Local $FirstFile = FileFindFirstFile($Path & "\*.*")
- While True
- $NextFile = FileFindNextFile($FirstFile)
- If @error Then ExitLoop
- $aFiles[0] += 1
- ReDim $aFiles[$aFiles[0]+1]
- $aFiles[$aFiles[0]] = $NextFile
- WEnd
- Return $aFiles
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement