How to find a text file within a folder then copy the folder and all sub folders

maybe this could be modified to do what i need ?