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, $Flag=0)
- Local $NextFile, $IsDir
- Local $aFiles[1] = [0]
- Local $FirstFile = FileFindFirstFile($Path & "\*.*")
- While True
- $NextFile = FileFindNextFile($FirstFile)
- $IsDir = @extended
- If @error Then ExitLoop
- If $Flag = 1 And $IsDir Then
- ContinueLoop
- Else
- $aFiles[0] += 1
- ReDim $aFiles[$aFiles[0]+1]
- $aFiles[$aFiles[0]] = $NextFile
- EndIf
- WEnd
- Return $aFiles
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement