Display subdirectory names in a directory

Results 1 to 3 of 3

Thread: Display subdirectory names in a directory

  1. #1
    Join Date
    Dec 1969

    Default Display subdirectory names in a directory

    I have this directory in my root and there are subfolders in it. I want to display the subfolder names instead of the files in it. How do I do this?

  2. #2
    Join Date
    Dec 1969

    Default RE: Display subdirectory names in a directory

    Search for FSO (File System Object)<BR><BR>Then search for the "SubFolders" Property.<BR>A "SubFolders" property of a folder contains a "Folders" collection (that is,a collection of "Folder" objects). This "Folders" collection represents the subfolders within the folder. This is a read-only property<BR><BR>xxx = objFolder.SubFolders<BR><BR>ASP 2.0 Programmer&#039;s Reference Wrox

  3. #3
    Join Date
    Dec 1969

    Default you will have to test this to see if it works.....

    &#060;% <BR>dim x(1000), path, filesystem, folder<BR>Const mypath="/otherfoldersinthisone/"<BR>Set filesystem = CreateObject("Scripting.FileSystemObject")<BR>Set folder = filesystem.GetFolder(server.mappath(mypath))<BR>Se t filecollection = folder.Folders<BR>&#039;Step through the folders list<BR>response.write "&#060;pre&#062;"<BR>For Each folder in filecollection<BR>response.write folder.name & vbcrlf<BR>Next<BR>response.write "&#060;/pre&#062;"<BR>set filesystem = nothing<BR>set folder = nothing<BR>set filecollection = nothing<BR>%&#062;<BR><BR>I am not 100% certain this will work, because I have not tested it with folders. I always look at files. But there is absolutely a way to look at the folders and map their paths, etc. Do a few searches on 4guysfromrolla.com and I am certain you will find a solution.<BR><BR>Edward<BR>http://www.1st-R8.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts