Version: 2.0
When using an instance of the Folder object, its SubFolder property returns a Folders collection consisting of all the subfolders (Folder objects) in that folder.
<%
Dim filesys, demofolder, subfol, folcoll, folist
Set filesys = CreateObject("Scripting.FileSystemObject")
Set demofolder = filesys.GetFolder(folderspec)
Set folcoll = demofolder.SubFolders
For Each subfol in folcoll
folist = folist subfol.Name
folist = folist "<BR>"
Next
Response.Write folist
%>
This code illustrates how to get a Folders collection and display its contents in the browser.
Syntax: object.Count
Returns an integer that tells us how many Folder objects there are in the collection.
Syntax: object.Item(key) [ = itemvalue]
The Item property allows us to retreive the value of an item in the collection designated by the specified key argument and also to set that value by using itemvalue.
Syntax: object.Add ("foldername")
This method is used to add a new Folder to a Folders collection.