E
Excel User
Hi,
I have the following script which lists all the folder names from
'mainfolder'
ListFolderContents(Server.MapPath("/mainfolder"))
sub ListFolderContents(path)
dim fs, folder
set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)
Response.Write(folder.Name & "<br>")
for each item in folder.SubFolders
ListFolderContents(item.Path)
next
end sub
but I would like to just list the first set of sub folders not the folders
within these sub folders i.e. if I had the following directory structure
mainfolder
- folder 1
- sub folder 1
- folder 2
- sub folder 2a
- sub folder 2b
- folder 3
so I would only like to list the folder names with 'mainfolder' but not
their sub-folders
i.e.
folder 1
folder 2
folder 3
Thanks for any help!
I have the following script which lists all the folder names from
'mainfolder'
ListFolderContents(Server.MapPath("/mainfolder"))
sub ListFolderContents(path)
dim fs, folder
set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)
Response.Write(folder.Name & "<br>")
for each item in folder.SubFolders
ListFolderContents(item.Path)
next
end sub
but I would like to just list the first set of sub folders not the folders
within these sub folders i.e. if I had the following directory structure
mainfolder
- folder 1
- sub folder 1
- folder 2
- sub folder 2a
- sub folder 2b
- folder 3
so I would only like to list the folder names with 'mainfolder' but not
their sub-folders
i.e.
folder 1
folder 2
folder 3
Thanks for any help!