It is currently Thu Jun 07, 2018 10:25 pm

All times are UTC - 8 hours [ DST ]


Forum rules


Before posting a bug report or a feature request, search the forum for an older post on the same topic.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Aug 23, 2016 7:30 am 
Offline

Joined: Tue Aug 23, 2016 7:26 am
Posts: 2
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 23, 2016 12:18 pm 
Offline
User avatar

Joined: Thu Jan 03, 2013 12:38 am
Posts: 5341
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.

_________________
Links to some general topics:

Compare Start Menus

Read the Search box usage guide.

I am a Windows enthusiast and did Classic Shell's testing and usability/UX feedback.


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 23, 2016 12:47 pm 
Offline

Joined: Tue Aug 23, 2016 7:26 am
Posts: 2
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?


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 23, 2016 1:48 pm 
Offline
User avatar

Joined: Thu Jan 03, 2013 12:38 am
Posts: 5341
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.

_________________
Links to some general topics:

Compare Start Menus

Read the Search box usage guide.

I am a Windows enthusiast and did Classic Shell's testing and usability/UX feedback.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Baidu [Spider] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group, Almsamim WYSIWYG Classic Shell © 2010-2016, Ivo Beltchev.
All right reserved.