Copy directories if their subdirectories contain “

2020-05-10 03:58发布

问题:

I want to copy multiple directories from one location to another location only if any of the subdirectories of those contain connect.txt file in them.

Example:

ANIMAL\DOG\CONNECT.TXT
PLANET\EARTH\CONNECT.TXT
SYSTEM\USER\ADMIN.TXT

Then I ONLY want to copy ANIMAL & PLANET directories to C:\DESKTOP.

回答1:

move *\*\connect.txt C:\Desktop This uses a regular expression which would work if you're really wanting to look only under the subdirectories of all directories at some location.