GetFiles

Returns a collection of strings representing the names of files within a directory.


Syntax

FileSystem.GetFiles(Directory)


Parameters


Directory

String, input



Directory to be searched.


Remarks


SpecialDirectories



AllUsersApplicationData

Gets a path name pointing to the Application Data directory for all users.


CurrentUserApplicationData

Gets a path name pointing to the Application Data directory for the current user.


Desktop

Gets a path name pointing to the Desktop directory.


MyDocuments

Gets a path name pointing to the My Documents directory


MyMusic

Gets a path name pointing to the My Music directory.


MyPictures

Gets a path name pointing to the My Pictures directory.


ProgramFiles

Gets a path name pointing to the Program Files directory.


Programs

Gets a path name pointing to the Programs directory.


Temp

Gets a path name pointing to the Temp directory.


Example

This example displays all files in the specified directory in a message box:


Sub Main()

For Each foundFile In FileSystem.GetFiles(SpecialDirectories.MyDocuments)

Msgbox foundFile

Next

End Sub