how to search a directory without looking at subdirectories?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
BigDan
Posts: 51
Joined: Tue May 23, 2017 9:24 pm

how to search a directory without looking at subdirectories?

Post by BigDan »

If I want to search for all the text files on my desktop but not the subdirectories on the desktop how would I do that?

To search just the desktop is easy enough. I'd just type "txt \desk" and without even finishing the word I'd be good. But yeah, that includes all the other stuff which I don't want.

If there's no way to exclude all subdirectories is there a way to just exclude one of them, ie the one which has the most irrelevant results? If for example there's a directory called books on my Desktop and I just wanted to exclude that, how would I do that?

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

Re: how to search a directory without looking at subdirectories?

Post by void »

Please try the parent: search function:

parent:c:\users\<user>\desktop

replace <user> with your username.

or, search under \desk with no subdirectories:
\desk !*\desk*\*\*

or, search under \desk, but exclude \books
\desk !\books
BigDan
Posts: 51
Joined: Tue May 23, 2017 9:24 pm

Re: how to search a directory without looking at subdirectories?

Post by BigDan »

thanks!

the parent function gives 0 hits, even after i replace the 'user' with my name. but the rest work fine, thank you!

what was supposed to happen with the parent function?
void
Developer
Posts: 15096
Joined: Fri Oct 16, 2009 11:31 pm

Re: how to search a directory without looking at subdirectories?

Post by void »

parent:<path> will limit the search to the specified path with no subfolders.

does parent:c:\users list any results?
If there is spaces in your username, please make sure you escape them with double quotes, for example:

parent:"c:\users\my user name\desktop"
BigDan
Posts: 51
Joined: Tue May 23, 2017 9:24 pm

Re: how to search a directory without looking at subdirectories?

Post by BigDan »

thanks for this

no, typing "parent:c:\users" without the quotes gives 0 results.
void
Developer
Posts: 15096
Joined: Fri Oct 16, 2009 11:31 pm

Re: how to search a directory without looking at subdirectories?

Post by void »

Please try with the quotes after parent:
eg:
parent:"c:\users"
BigDan
Posts: 51
Joined: Tue May 23, 2017 9:24 pm

Re: how to search a directory without looking at subdirectories?

Post by BigDan »

Please try with the quotes after parent:
eg:
parent:"c:\users"

so sorry just seeing this now somehow hahah

i tried that. didn't work either

parent:"c:\users\BigDan\desktop" xls


Btw earlier I was given this command:
\desk !*\desk*\*\* xls
which worked pretty well. The issue with that is that I also see certain files that are on the H drive desktop. And I also saw files in the folder
C:\Old Computer\Desktop which is the wrong folder.

These aren't big deals by any means. But is there a way to restrict to C:\users\ (any option here) \ Desktop ? I was hoping I could type
C:\users\*\Desktop but for some reason that didnt work.
vanisk
Posts: 152
Joined: Sat Oct 27, 2018 11:33 am

Re: how to search a directory without looking at subdirectories?

Post by vanisk »

btw, you didn't answer @void's question
does parent:c:\users list any results?

Try this

Code: Select all

parent:"%userprofile%\Desktop" xls
but for this to work, we have to enable "Expand Environment Variables" [Edit: idk if its enabled by default or not]

everything desktop parent txt.png
everything desktop parent txt.png (29.73 KiB) Viewed 5761 times
NotNull
Posts: 5167
Joined: Wed May 24, 2017 9:22 pm

Re: how to search a directory without looking at subdirectories?

Post by NotNull »

Are you on a company computer?
Most companies have group policies in place for folder redirection (like the desktop folder).

What folder path do you see when you search for
shell:desktop
?
Post Reply