ASP Files Collection Last Updated : 19 Mar, 2021 Comments Improve Suggest changes Like Article Like Report The ASP Files Collection is used to return the collection of all the files present in a specified folder. These can be looped through to get the details of the individual files. Syntax: FolderObject.Files Example: The below code demonstrates the ASP File.Files Collection. ASP <% dim fs,fo,x set fs=Server.CreateObject("Scripting.FileSystemObject") 'Get the folder to be read set fo=fs.GetFolder("d:\geeks\") 'Loop through the files present in the folder for each x in fo.files 'Print the name of the file Response.write("Filename: " & x.Name & "<br>") next set fo=nothing set fs=nothing %> Output: Filename: GFG_adv.txt Filename: sudo.txt Filename: ram.txt Filename: shyam.txt Comment More infoAdvertise with us Next Article ASP Files Collection M manaschhabra2 Follow Improve Article Tags : Websites & Apps ASP-Basics Similar Reads ASP SubFolders Collection The ASP SubFolders Collection is used to return the collection of all the subfolder in a specified folder. Syntax: FolderObject.SubFolders Example: The below code demonstrates the ASP Folder.SubFolders Collection. ASP <% dim fs,fo,x set fs=Server.CreateObject("Scripting.FileSystemObject") 'Get t 1 min read ASP GetFile Method The GetFile Method in ASP is used to return the File object corresponding to the file in a specified path. It is a predefined method of the FileSystem Object. Syntax: FileSystemObject.GetFile(path) Parameter Values: path: It is a required attribute. It specifies the path for the File. Example Code 1 min read ASP RootFolder Property The ASP RootFolder Property is used to return a Folder object which indicates the root folder of the specified drive. Syntax: DriveObject.RootFolder Example: The below code illustrates the ASP Drive.RootFolder Property. ASP <% dim fs,d set fs=Server.CreateObject("Scripting.FileSystemObject") 'Get 1 min read ASP GetFileName Method The GetFileName Method in ASP is used for returning the string value that represents the name of the ASP File. Or folder for the last component in a specified path. Syntax: FileSystemObject.GetFileName(path) Parameter Values: path: It is a required attribute. It specifies the absolute or a relative 1 min read ASP GetFolder Method The ASP GetFolder Method is used for returning the Folder object corresponding to the folder for a specified path. It is an in-built method of the FileSysten Object. Syntax: FileSystemObject.GetFolder(path) Parameter Values: Path:It is a required attribute. It specifies the path to a specified Fold 1 min read Like