Limiting search to within a folder

General discussion related to "Everything".
Post Reply
dalchina
Posts: 3
Joined: Wed Aug 03, 2016 8:54 am

Limiting search to within a folder

Post by dalchina »

Hi, How do you limit the search results to a specific folder? I imagine I'm missing sthg obvious.

I've used Locate32 for years, which operates on a very similar basis. Its GUI readily allows be to select the folder from which I want results. (Likewise size, date range, extension etc).

I can't find a way to do the first with Everything - I looked at the Search Syntax, and can see ways to specify size and date range, not the folder.

Also the GUI way with Locate32 is intuitive, whereas using search syntax is not.

Thanks.
void
Developer
Posts: 15096
Joined: Fri Oct 16, 2009 11:31 pm

Re: Limiting search to within a folder

Post by void »

Type the folder path into the search edit, for example to find files in c:\Windows, search for:
c:\windows\

Use double quotes to escape spaces, for example to find files in C:\Program Files, search for:
"c:\program files\"
therube
Posts: 4580
Joined: Thu Sep 03, 2009 6:48 pm

Re: Limiting search to within a folder

Post by therube »

If you only wanted C:\Windows (no subdirectories), you can use the parent: function.

Code: Select all

parent:C:\Windows\
void
Developer
Posts: 15096
Joined: Fri Oct 16, 2009 11:31 pm

Re: Limiting search to within a folder

Post by void »

Note: parent: only works in Everything 1.4+
dalchina
Posts: 3
Joined: Wed Aug 03, 2016 8:54 am

Re: Limiting search to within a folder

Post by dalchina »

Hi, thanks.

I'm too used to the GUI way in Locate32...
mwsm
Posts: 21
Joined: Thu Feb 28, 2013 2:01 am

Re: Limiting search to within a folder

Post by mwsm »

If you prefer a GUI, try the "Search > Advanced Search..." dialog in Everything 1.4+.
SuperDude
Posts: 219
Joined: Thu Sep 25, 2014 7:57 pm

Re: Limiting search to within a folder

Post by SuperDude »

While Everything has an option to add a context menu entry for folders, it doesn't have an icon that makes it easy to quickly identify, which can be a hassle if your context menu has a lot of other entries in it, and its menu text is a plain Search Everything... So, I made my own context menu entry that has an icon, and it has customized text that stands out from the other entries.

If you want to search just a specific folder and its sub-folders, you can use my customized registry entry, which will let you do the following:

❶ Create a context menu that has customized text of your choice. ❷ You can choose an icon that will be shown for the context menu entry.

I use Everything as a portable app, I don't use the installer version. I have Everything running from this folder: C:\Everything If you are using the installed version, just modify the path to the Everything.exe file.

My registry key looks like this:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\Search FOLDER with &Everything]
"Icon"="\"C:\\Everything\\Everything.ico\""

[HKEY_CLASSES_ROOT\Directory\shell\Search FOLDER with &Everything\Command]
@="\"C:\\Everything\\Everything.exe\" -path \"%1\""

You can copy the above code and save it as a file, like Search FOLDER with Everything.reg

Then just double-click on the .reg file to merge it into the registry. This is what my context menu looks like:

Image

So, if you want to limit a search to just the C:\Windows folder (and its sub-folders), you would just have to right-click on the C:\Windows folder, then click on Search FOLDER with Everything. This is what the Everything search window will look like:

Image
dalchina
Posts: 3
Joined: Wed Aug 03, 2016 8:54 am

Re: Limiting search to within a folder

Post by dalchina »

Many thanks - comprehensive and informative.
gdv
Posts: 22
Joined: Fri Feb 22, 2013 3:57 am

Re: Limiting search to within a folder

Post by gdv »

SuperDude wrote:If you want to search just a specific folder and its sub-folders, you can use my customized registry entry, which will let you do the following:

❶ Create a context menu that has customized text of your choice. ❷ You can choose an icon that will be shown for the context menu entry.

I use Everything as a portable app, I don't use the installer version. I have Everything running from this folder: C:\Everything If you are using the installed version, just modify the path to the Everything.exe file.

My registry key looks like this:

Code: Select all

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Search FOLDER with &Everything]
"Icon"="\"C:\\Everything\\Everything.ico\""

[HKEY_CLASSES_ROOT\Directory\shell\Search FOLDER with &Everything\Command]
@="\"C:\\Everything\\Everything.exe\" -path \"%1\""
You can copy the above code and save it as a file, like Search FOLDER with Everything.reg
@SuperDude: Thanks for the nifty context menu registry hack !!! :D
SuperDude
Posts: 219
Joined: Thu Sep 25, 2014 7:57 pm

Re: Limiting search to within a folder

Post by SuperDude »

@gdv: Glad you liked it. I like to create my own context menus rather than using the ones programs install. It gives me the option to use any icon I want, and it lets me add icons to context menu entries that normally don't have an icon. I think icons are are much easier and faster when it comes to identifying what a certain context menu entry does. I can also choose whatever text I want the context menu to display. Once I've made an entry, I export the registry key, in case I have to re-install Windows at a later time. A simple double-click and I'm back in business.
gdv
Posts: 22
Joined: Fri Feb 22, 2013 3:57 am

Re: Limiting search to within a folder

Post by gdv »

SuperDude wrote:@gdv: Glad you liked it. I like to create my own context menus rather than using the ones programs install. It gives me the option to use any icon I want, and it lets me add icons to context menu entries that normally don't have an icon. I think icons are are much easier and faster when it comes to identifying what a certain context menu entry does. I can also choose whatever text I want the context menu to display. Once I've made an entry, I export the registry key, in case I have to re-install Windows at a later time. A simple double-click and I'm back in business.
Yeah, those are exactly the reasons I appreciated your post. I've always wanted (and intended) to figure out how to custom-design my own context menu items with icons, but had never gotten around to it. I've used a few different utilities to add/customize context menu items, but I didn't usually save (or even look at) the resulting registry key. Then usually so much time passes before I need a custom context menu item again that I've lost track of the utilities and/or moved on to a completely different system and have to go scrounge up the utilities all over again.

I saw your post (and accompanying registry file) and realized it could serve as a nice little tutorial that I'll just keep with my collection of other registry info for future use.

Thanks again. ;)
Ramses2
Posts: 3
Joined: Sun Sep 25, 2016 9:39 pm

Re: Limiting search to within a folder

Post by Ramses2 »

Brand new here but using everything for years here my question:
In a same folder how can I show a list of sub folders that only contain mp3 files but not the individual files themself?
froggie
Posts: 297
Joined: Wed Jun 12, 2013 10:43 pm

Re: Limiting search to within a folder

Post by froggie »

Ramses2 wrote: In a same folder how can I show a list of sub folders that only contain mp3 files but not the individual files themself?
with the match path search option on:
foldername child:.mp3

or without match path :
\foldername child:.mp3
Ramses2
Posts: 3
Joined: Sun Sep 25, 2016 9:39 pm

Re: Limiting search to within a folder

Post by Ramses2 »

froggie wrote:
Ramses2 wrote: In a same folder how can I show a list of sub folders that only contain mp3 files but not the individual files themself?
with the match path search option on:
foldername child:.mp3

or without match path :
\foldername child:.mp3
It did works for most of my folder thank you for that
but for some other with a main folder and some subfolder I got them separated when the parent folder ex My Music\Flying Dutchman\ got several sibling folders inside like CD1 and CD2 and jpg the search point at cd1 and cd2 witch each contains .MP3 instead of main one Flying Dutchman witch is the main container I am interested in.
therube
Posts: 4580
Joined: Thu Sep 03, 2009 6:48 pm

Re: Limiting search to within a folder

Post by therube »

main one Flying Dutchman witch is the main container I am interested in
I don't think you're going to be able to do that?

While you may know that you're actually going to want the parent directory to what was found, "Flying Dutchman" is kind of ambiguous too because it may not necessarily be the immediate parent.

Code: Select all

X:\HARRY NILSSON
+---CD1
|       01 1941.mp3
|       02 Without Her.mp3
|       03 As I Wander Lonely.mp3
|       04 Ten Little Indians.mp3
|       05 You Can't Do That.mp3
|       06 Miss Butter's Lament.mp3

Code: Select all

X:.
\---HARRY NILSSON
    \---lyrics
        \---jpg
            +---CD1
            |       01 1941.mp3
            |       02 Without Her.mp3
            |       03 As I Wander Lonely.mp3
            |       04 Ten Little Indians.mp3
            |       05 You Can't Do That.mp3
            |       06 Miss Butter's Lament.mp3
Ramses2
Posts: 3
Joined: Sun Sep 25, 2016 9:39 pm

Re: Limiting search to within a folder

Post by Ramses2 »

therube wrote:
main one Flying Dutchman witch is the main container I am interested in
I don't think you're going to be able to do that?

While you may know that you're actually going to want the parent directory to what was found, "Flying Dutchman" is kind of ambiguous too because it may not necessarily be the immediate parent.

Code: Select all

X:\HARRY NILSSON
+---CD1
|       01 1941.mp3
|       02 Without Her.mp3
|       03 As I Wander Lonely.mp3
|       04 Ten Little Indians.mp3
|       05 You Can't Do That.mp3
|       06 Miss Butter's Lament.mp3

Code: Select all

X:.
\---HARRY NILSSON
    \---lyrics
        \---jpg
            +---CD1
            |       01 1941.mp3
            |       02 Without Her.mp3
            |       03 As I Wander Lonely.mp3
            |       04 Ten Little Indians.mp3
            |       05 You Can't Do That.mp3
            |       06 Miss Butter's Lament.mp3

Your example is kind of similar to mine so instead is it possible to find all the immediate parent folder of CD1 or CD2 without worry about child content?
therube
Posts: 4580
Joined: Thu Sep 03, 2009 6:48 pm

Re: Limiting search to within a folder

Post by therube »

the immediate parent folder of CD1 or CD2
As I tried to point out, the immediate parent might not give you the intended results either.

In my first example, it would return your wanted "HARRY NILSSON".
In the second example, it would return, "jpg".

And if you said, well, how about two directories up?
In that case, you end up with "X:" & "lyrics", so again not what you want.

If you "know" that in all instances of /CD1/ & /CD2/ that the parent is going to be what you want, if parents: accepted a negative value, & if that applied to some relative location, like that found by child:..mp3, then you could say something like:

child:.mp3 parents:-1

but as it is that can't be done, & I'm not thinking of a work-around that would work either?
enchilea33
Posts: 2
Joined: Mon Dec 09, 2019 10:19 pm

Re: Limiting search to within a folder

Post by enchilea33 »

Sorry to bump an old thread, but I can't seem to get this to work for network folders. For example I am searching: parent://share/subfolder

I've also tried escaping the / with additional / as well as putting the path in quotes

I am using the latest Everything (1.4.1.935 x64)
therube
Posts: 4580
Joined: Thu Sep 03, 2009 6:48 pm

Re: Limiting search to within a folder

Post by therube »

Without parent:, can you //share/subfolder & have results returned?

Did you try /share/subfolder?
Or \share\subfolder?

Is the share NTFS?
If not, you'd need to do something like setting up a Folder Index.


(And for those that generally don't like backslashes ;-); Tools | Options | General -> Replace forward slashes with backslashes.
With that, you can use either / or \ or / and \.)
enchilea33
Posts: 2
Joined: Mon Dec 09, 2019 10:19 pm

Re: Limiting search to within a folder

Post by enchilea33 »

Sorry yes I meant with backslahes \

Good point. Even without parent, it doesn't work.

The share isn't NTFS, but I didn't want to have to index it. Currently I'm using AgentRansack which seems to work fine without indexing.
usermedium
Posts: 1
Joined: Wed Mar 03, 2021 9:00 am

Re: Limiting search to within a folder

Post by usermedium »

You can also you use exclude option under options. Works for me and I now only search in my network folder S:\\ :D. Of coures you will need to add the network folder under folders in options
Post Reply