Results 1 to 2 of 2

Thread: How do I find all the folders and subfolders without using the filesystem object ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Posts
    5

    How do I find all the folders and subfolders without using the filesystem object ?

    I am trying to make my own explorer using the Treeview control.

    Does anyone know of examples from the net ?

    I can find all the folder names by the following code:

    "
    Dim numOfFolders
    numOfFolders = dirSelect.ListCount

    Dim folderCount
    Dim folderName

    for folderCount = 0 to numOfFolders - 1

    folderName = dirSelect.List(folderCount)

    Next folderCount
    "

    But how do I find out all the subfolder names and all the files that belong to these foldes ???

    I CANNOT USE the filesystem object. Is there any other way ??

    Thanks for your help.
    Predator.

  2. #2
    Hyperactive Member
    Join Date
    Jul 2000
    Location
    Halifax,UK
    Posts
    274
    you can use the dri command

    for folders...
    VB Code:
    1. dim strFolderName as string
    2.    
    3.    strFolderName=dir("c:\*.",16)
    4.    do until strFoldername=""
    5.        msgbox strFolderName  
    6.        strFolderName=dir
    7.    loop

    for files
    VB Code:
    1. dim strFolderName as string
    2.    
    3.    strFolderName=dir("c:\*.*")
    4.    do until strFoldername=""
    5.        msgbox strFolderName  
    6.        strFolderName=dir
    7.    loop
    VB6 VS2005

Posting Permissions

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



Click Here to Expand Forum to Full Width