Delete specific folders from a directory that are contained in another directory

Axmann8

Honorable
Jul 14, 2012
7
0
10,510
Directory 1 only contains a bunch of folders that we'll call "Group A". Directory 2 contains the Group A folders in addition to a bunch of other folders we'll call "Group B" [Group B contains no Group A items].

In other words:

D1= A
D2= A+B

What I want to do is delete ONLY Group A folders from Directory 2, while keeping Group B folders intact there. Therefore, Directory 1 will only contain Group A and Directory.

So I want it to come out as:

D1=A
D2=B

There are far too many folders to do this manually. In addition, when I delete Group A in Directory 2, not only the folders but everything inside of the Group A folders must be deleted as well.

How can I accomplish this? Is there a way to create a list of Group A's folders and then somehow use this list as an input for deleting them in Directory 2?
 

wavetrex

Distinguished
Jul 6, 2006
254
0
18,810
Find and use Total Commander

The flexibility of file and directory selection and operation is simply amazing.
Compared with it, using "Explorer" seems like using a prehistoric stone tool compared to modern robotics.