Sorry if I asked not good question. I am relatively new to Visual C++. I tried the CfileFind class. It seems that this the right one. But I still have some problems. The following is the code I tried. It works ok to find the specific file or directory. But when I tried to test whether this is a directory or not, it gives an "assertion failure". I have no idea how it happenes. Can you tell me what went wrong? Also, if possible, can you give me a little example (several lines) of how this may work? Thanks a lot. CFileFind finder; BOOL bWorking = finder.FindFile(filename); if(bWorking) { if(finder.IsDirectory()) { ...............