getting list of directories into list box 
Author Message
 getting list of directories into list box

Hello,
        I wish to get a list of sub-directories into a list box..  for
example, if I specify C:\windows\  I want the lsit box to contain

Program Files
System
etc etc

but only the directories..  and ultimately I wish to output jsut the
directory names to a text file..  But if I can get them into a list
box, i will be able to do the rest.. :)

thank you
Danny

btw- using Visual Basic 6.0

Chef Groovy
ICQ: 1529949



Fri, 10 May 2002 03:00:00 GMT  
 getting list of directories into list box
    Dim sFile As String, sPath As String
    sPath = "c:\windows\"
    sFile = Dir(sPath & "*.*", vbDirectory)
    While Len(sFile)
        If GetAttr(sPath & sFile) And vbDirectory Then
            List1.AddItem sFile
        End If
        sFile = Dir
    Wend

Lee Weiner
weiner AT fuse DOT net
http://home.fuse.net/lweiner



Quote:
>Hello,
>        I wish to get a list of sub-directories into a list box..  for
>example, if I specify C:\windows\  I want the lsit box to contain

>Program Files
>System
>etc etc

>but only the directories..  and ultimately I wish to output jsut the
>directory names to a text file..  But if I can get them into a list
>box, i will be able to do the rest.. :)

>thank you
>Danny

>btw- using Visual Basic 6.0

>Chef Groovy
>ICQ: 1529949



Sat, 11 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Directory list in the list box

2. Help: displaying hidden directories in directory list box

3. How to list macro names in a combo box or a list box

4. Help wanted with file list boxes and list boxes

5. VB List Box Versus Access List Box

6. Q: List Box to List Box Code

7. List box within List box

8. List box within List box

9. List box within List box

10. Drive List and Directory List

11. Getting list of files in a directory

12. ?? Getting Directory Listing with qbasic

 

 
Powered by phpBB® Forum Software