franknasr
asked on
How do I get an array of file names from a directory
I have a directory on a server that contains over 40000 files and I need an array to contain the names of all of these files so that I can then do something with them. I was wondering if there was a nice VB tool that could do this for me.
My original thought was to use a file list box and then sequentially grab the names of each file and write them to the array but I discovered that file list boxes cannot handle this many files so I am at a loss.
Thank you for any help you can offer me.
My original thought was to use a file list box and then sequentially grab the names of each file and write them to the array but I discovered that file list boxes cannot handle this many files so I am at a loss.
Thank you for any help you can offer me.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This was perfect thank you very much.
dim arr() as string,ff as string
dim l as long
ff=dir$(sPath & "\*.*", vbarchive)
do while ff<>""
redim preserve arr(l)
arr(l)= sPath & "\" & ff
l=l+1
ff=dir$()
loop