Delete objects in explorer by layer in Max

Hello!

I have a folder that contain set of folders with many files in it
So in windows explorer I have:

folder1:
1.obj,2.obj,.......,150.obj

folder2:
1.obj,2.obj,.......,150.obj

and so on...

Each folder contain just a few files that I realy need(with different names)
So in Max I make a layer for each folder and keep only needed objects, so it's like:

Layer1:
4.obj, 8.obj, 20.obj

Layer2:
6.obj, 104.obj, 110.obj

and so on...

So I need a script to delete the files from each folder(explorer), that don't exist in each layer(MAX)