I guess it only can be a recursive procedure that starts from root and scans all folders. You can build it on ADIR() function, or on Shell32 COM object, or on API calls. The scanning itself is going to be time consuming. Depending on whether the whole disk is scanned and how dense it is populated it may take from 30 seconds to 5 minutes to complete.
VFP code sample:
Building a tree of subdirectories for a given path using FindFile functionshttp://www.news2news.com/vfp/?example=236&function=378It takes about 30 seconds for this code to scan 4698 subdirectories in Program Files folder on Pentuim(R)4 CPU 1.6 GHz with 512 MB of RAM.
I wonder if hooking to Windows Indexing Service or to Google Desktop is possible to obtain file locations faster. Though you may not have them running on every computer you install your software on.