Here is a basic example using _FileListToArrayRec:
#include <Array.au3>
#include <File.au3>
Global $g_sFolderRoot = @ScriptDir & "\Dir A"
_ExampleFolders()
;~ Get list of folders before any changes are made
Global $g_aFolderBefore = _FileListToArrayRec($g_sFolderRoot, "*", 2)
;~ Create Random Folder
DirCreate($g_sFolderRoot & "\SubDir" & Round(Random(100, 500)))
;~ Get list of new folder(s)
Global $g_aGetRandomFolder = _FileListToArrayRec($g_sFolderRoot, "*|" & _ArrayToString($g_aFolderBefore, ";", 1), 2)
_ArrayDisplay($g_aGetRandomFolder)
Func _ExampleFolders()
If Not FileExists($g_sFolderRoot) Then DirCreate($g_sFolderRoot)
For $i = 1 To 5
If Not FileExists($g_sFolderRoot & "\SubDir" & $i) Then DirCreate($g_sFolderRoot & "\SubDir" & $i)
Next
EndFunc