Hi Hannu,
The List Directory VI is slow primarily because it tries to resolve any shortcuts in the directory and make sure that they are valid. If there are several shortcuts, this operation will definitely take some time, especially if some of the shortcuts are broken. This issue has been documented and NI's R&D department is aware of the problem.
The List Directory VI does have better performance in LabVIEW 7.1 as well as on a computer using a NTFS file system format.
The previous post by Audrey Dmitriev suggests making calls to the Windows API functions. This is another workaround and you can use the LabVIEW Call Library Node VI to call a Windows DLL. The following article may be helpful for you:
KnowledgeBase 1GRAN2U0. Where Can I Get Help Calling Windows API Functions from LabVIEW?Note that there is an excellent Developer Zone example program that is linked off that page as well.
Good luck!
Kileen C.
Applications Engineer
National Instruments