1
Answer

Getting Main directory Name

Kevin Davis

Kevin Davis

13y
1.7k
1
HI all.

I have several folders that have folders inside of them.  I'm trying to get just the top level folder name, such as,

I have:
D:\Music\Rock\Scorpions
D:\Music\Rock\Scorpions\World Wide Live


I just want to return "Music" for both lines.  I know how to get a list of all the directories for a certain drive, but when I scan directories for all files, I just want to return the top level directory name.

Thanks for your help!

Zcast
Answers (1)