How to get the List of all subfolders in QTP – VBScript Code

Share This Post -

With the help of FileSystemObject, we can get the List of all subfolders in QTP. Lets assume that Folder Structure is:

Test folder structure for QTP

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

How to get the List of all subfolders in QTP – VBScript Code