how to search a directory without looking at subdirectories?

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

how to search a directory without looking at subdirectories?

Post by BigDan » Wed May 08, 2019 7:15 am

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
Site Admin
Posts: 4717
Joined: Fri Oct 16, 2009 11:31 pm

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

Post by void » Wed May 08, 2019 7:23 am

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: 9
Joined: Tue May 23, 2017 9:24 pm

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

Post by BigDan » Wed May 08, 2019 10:38 am

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
Site Admin
Posts: 4717
Joined: Fri Oct 16, 2009 11:31 pm

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

Post by void » Wed May 08, 2019 10:45 am

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: 9
Joined: Tue May 23, 2017 9:24 pm

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

Post by BigDan » Wed May 08, 2019 11:40 am

thanks for this

no, typing "parent:c:\users" without the quotes gives 0 results.

void
Site Admin
Posts: 4717
Joined: Fri Oct 16, 2009 11:31 pm

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

Post by void » Wed May 08, 2019 11:41 am

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

Post Reply