How to search for all files that are being used.

How would I search for all of the parts in a folder that are being used by another file? (Usually an assembly or a drawing)  I know you can check the where used tab and see that a certain part will be called out by an assembly, but I want to find all of the files in a folder that are being used.  (So I can delete the others).  Thanks.

SolidworksSolidworks Pdm enterprise Pdm