326
Post New Requests Here / IDEA: Delete all files except two particular ones
« Last post by nkormanik on December 08, 2013, 07:39 PM »This little challenge probably just involves some correct batch code, I'm guessing. But maybe someone writing a small program would be worthwhile. Don't know.
Suppose we have a tree-full of folders. Each folder has lots of .png files of various names.
I want to delete every single .png file in the entire folder-tree (recursive?) EXCEPT for two:
"keep_this_one.png"
"save_me_as_well.png"
"keep_this_one.png" and "save_me_as_well.png" MUST be kept (i.e., leave alone), in the various folders they are located in.
All the other .png files are to be deleted.
Leave any non-png files alone.
Any help?
Thanks much.
As always, if the solution already exists, please direct me.
Nicholas Kormanik
Suppose we have a tree-full of folders. Each folder has lots of .png files of various names.
I want to delete every single .png file in the entire folder-tree (recursive?) EXCEPT for two:
"keep_this_one.png"
"save_me_as_well.png"
"keep_this_one.png" and "save_me_as_well.png" MUST be kept (i.e., leave alone), in the various folders they are located in.
All the other .png files are to be deleted.
Leave any non-png files alone.
Any help?
Thanks much.
As always, if the solution already exists, please direct me.
Nicholas Kormanik