Well, I was somewhat hoping that you would pick up on what needed to be done
.... and I now see that you did. Well done.
Excel User wrote:
> Bob, thanks for the reply but changing this just repeats the folder
> name several times i.e.
>
> mainfolder
> mainfolder
> mainfolder
> mainfolder
>
> any ideas?
>
> Thanks
>
> "Bob Barrows" <> wrote in message
> news:#...
>> Excel User wrote:
>>> 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
>>> Response.Write(folder.Name & "<br>")
>>> 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
>>
>> Replace the recursive call to the sub with a statement to write the
>> subfolder name to Response. See above
>>
>> --
>> HTH,
>> Bob Barrows
--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
|