Latest web development tutorials

ASP Files collection

Folder Object Reference Complete Folder Object Reference

Files collection to return a collection of the specified folder of all the files.

grammar

FolderObject.Files

Examples

<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test\")

for each x in fo.files
'Print the name of all files in the test folder
Response.write(x.Name & "<br>")
next

set fo=nothing
set fs=nothing
%>

Output:

test_adv.txt
guestbook.txt
links.txt
links2.txt
textads.txt
textfile.txt


Folder Object Reference Complete Folder Object Reference