Get folder names in a directory

Hello,

I am currently developing a process that creates folders using a person’s surname, moves files into it, and zips it up.

The creation of folders and moving of files works fine, but how would I get the folder names in a directory? The number of folders will vary and the Directory.GetFiles I am using does not work.

Any help would be appriciated. Thanks in advance!

Hi William,

Use this

Directory.GetDirectories(“youFolderPath”,“.”,SearchOption.AllDirectories)

Hope it will work.

It will give you folders in the directory

1 Like

Hey @ghazanfar,

This has worked, thank you!

1 Like

Welcome :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.