For example,if the directory structure is like below c:\tests\foo.rtf c:\tests\data\foo.ftp if we run the script from c:\tests,it should print foo.rtf