How to list name of subfolders of a folder

Let’s assume, we have D:PFolder where 3 subfolders present named as sun1, sun2 & sun3
We will use FileSystemObject as class name to deal with folders.

Set a = CreateObject(“Scripting.FileSystemObject”)
Set b = a.GetFolder(“D:QTP_TEST”)
Set c = b.SubFolders
For Each d in c
e=e&d.name&vbnewline
Next
msgbox e

Content posted is based on learning or working experience, please leave comments if anything needs to be added or updated, discuss your queries on our facebook:qavalidation.com, Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: