GetFolder Method
Updated: September 2010
Returns a Folder object corresponding to the folder in a specified path.
object.GetFolder(folderspec)
An error occurs if the specified folder does not exist.
The following example illustrates the use of the GetFolder method.
function ShowFolderList(path) { var fso = new ActiveXObject("Scripting.FileSystemObject"); var folder = fso.GetFolder(path); var subFlds = new Enumerator(folder.SubFolders); var s = ""; for (; !subFlds.atEnd(); subFlds.moveNext()) { s += subFlds.item() s += "<br />"; } return (s); }
Function ShowFolderList(path)
Dim fso, folder, subFlds, fld, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(path)
Set subFlds = folder.SubFolders
s = ""
For Each fld in subFlds
s = s & fld.name
s = s & "<br />"
Next
ShowFolderList = s
End Function
Applies To:
Community Additions
Show: