Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve Names of Subdirectories

Status
Not open for further replies.

Kocheace

Vendor
Oct 31, 2002
97
US
Hello everyone...

Does anyone know of a way to retrieve the names of all subdirectories in a directory?


Say 'ello..... to my little friend!
 
You can try something like this:
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("\path\to\directory")
For Each sf in f.SubFolders
MsgBox sf.Name
Next sf
You may reference the Scripting Runtime Library

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
PHV - you are FAST! I was replying (same answer as you), turned away to talk to someone and whooosh there you were.



Gerry
 
I'll give it a try and get back to you all. Thanks for responding

Say 'ello..... to my little friend!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top