I want to find all the folders inside a folder

Is there any way to get all the folder names inside a folder?

1 Like

please refer above link.

Assign strArray(system.string[])= Directory.GetDirectories(“Folder Path”)
Use For each loop to itirate through all the folder.

1 Like

Use Directory.GetDirectory(“path”)


folder_name(Variable type is in array of String)



hi Poovarasan 2 ,
I need only display folder names inside the folder … your output shows absolute path … i need only display relative paths only… can you help me

thanks in advance,

Please use same code as suggested by @Poovarasan2 and pass out put variable into a Messagebox

hi ajith,
Use Path.GetFileName(“string name”) in your for each loop like this…


hi i hope this will help you …i am sure