Copy directories if their subdirectories contain "connect.txt" I want to copy multiple directories from one location to another location only if any of the subdirectories of those contain the connect.txt file in them.
Example:
C:\ANIMAL\DOG\CONNECT.TXT
C:\PLANET\EARTH\CONNECT.TXT
C:\SYSTEM\USER\ADMIN.TXT
Then I ONLY want to copy ANIMAL & PLANET directories to C:\DESKTOP.
INPUT :
C:\ANIMAL\TIGER\CONNECT.TXT
C:\ANIMAL\LION\WILD.TXT
C:\PLANET\EARTH\CONNECT.TXT
C:\SYSTEM\USER\ADMIN.TXT
C:\SYSTEM\USER\DOG.TXT
C:\SYSTEM\USER\CAT.TXT
OUTPUT:
C:\DESKTOP\ANIMAL
C:\DESKTOP\EARTH