Command to delete files with a filter?

Sony Vegas and Sound Forge create .SFK files which are graphical representations of audio files. There is no mechanism for deleting old useless ones. They just clutter up my drives.

I've already set up a filter to find files of type SFK not accessed in the last month, but how would I put this on a button which gave me some feedback while the delete is taking place. For example it would be great if it showed me what files it's deleting and when it's finished.

I've got as far as this but I don't know the rest:



You could use a button command like:

Find FILTER NAME "SFK_no_access_1_month.flt" IN "C:\My Dir"

To assign your filter to a button that lists all the appropriate .SFK files in C:\My Dir\ (or whatever directory want to search) in an output window. From there you can select and delete the files as you wish.

If using the Find method isn't what you want then I think the Delete FILTER="SFK_no_access_1_month" style button should work on its own.

Unless you add a filespec (e.g. a wildcard) to the command it will only work on the selected items. So you still have to select the files/folders that you want the delete to work on, unless you give it * to make it work on all files/folders.

(Also, I think the filter part only applies to items in subdirectories: Any selected files in the current directory will be deleted regardless of the filter. Worth double-checking, though.)

So there's no way to pipe the output of a find command into a delete command?

This is what I've now got for the "find" method to search through all local drives:

Find FILTER NAME "SFK_no_access_1_month.flt" IN "C:, D:, E:, F:, G:, H:"

Can the following be made to work recursively through sub-folders if I run it from "My Computer"?

Delete * FILTER="SFK_no_access_1_month"

Instead of directing the find results to the output window, would creating a file collection for the find operation help - and modify the find command to direct the results there using the COLLNAME argument? I imagine you could then do some sort of SELECT ALL and DELETE...