'======================================== Function xFile_GetAllFolders Dim oWMIService, oFolders, oFolder, iFolderCount, asFolders() iFolderCount = 0 Set oWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set oFolders = oWMIService.ExecQuery("Select * from Win32_Directory") For Each oFolder in oFolders ReDim Preserve asFolders(iFolderCount) asFolders(iFolderCount) = oFolder.Name iFolderCount = iFolderCount + 1 Next xFile_GetAllFolders = asFolders End Function '========================================