Classic Shell
http://classicshell.net/forum/

delete all but specific file type
http://classicshell.net/forum/viewtopic.php?f=13&t=6595
Page 1 of 1

Author:  jaykappy [ Tue Aug 23, 2016 7:30 am ]
Post subject:  delete all but specific file type

I am trying to run a command that will search a bunc h of folders and DELETE ALL files EXCEPT a specific file.
I am using this right now.
for %i in (*) do if not %i == .msg del %i
Questions:
1. This does not work on subfolders. How do I modify it to do so?
2. How do I specify more than one type of file to KEEP (right now only the .msg are kept)

PLEASE HELP!!!!! Cheers

Author:  Gaurav [ Tue Aug 23, 2016 12:18 pm ]
Post subject:  Re: delete all but specific file type

Classic Explorer custom commands cannot recurse folders.

A faster way that works on subfolders would be to use the Explorer search box. Suppose you want to keep *.txt files but delete all other files, then type this into the Explorer search box:

*.* NOT *.txt

Then select all the the search results and delete.

Author:  jaykappy [ Tue Aug 23, 2016 12:47 pm ]
Post subject:  Re: delete all but specific file type

1. When I do the search is shows the folders as well....I dont want to delete the folders only files.


2. Can I string this together somehow and search for .pdf and .msg?

Author:  Gaurav [ Tue Aug 23, 2016 1:48 pm ]
Post subject:  Re: delete all but specific file type

That was just an example. You can use the Windows Search Advanced Query Syntax: viewtopic.php?f=4&t=1588#WindowsSearchAQS

Find the query that suits your requirement.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/