how to search a directory without looking at subdirectories?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
BigDan
Posts: 10
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: 4844
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: 10
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: 4844
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: 10
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: 4844
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"

BigDan
Posts: 10
Joined: Tue May 23, 2017 9:24 pm

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

Post by BigDan » Tue Jul 30, 2019 7:03 am

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: 143
Joined: Sat Oct 27, 2018 11:33 am

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

Post by vanisk » Tue Jul 30, 2019 9:39 am

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
You do not have the required permissions to view the files attached to this post.

NotNull
Posts: 1393
Joined: Wed May 24, 2017 9:22 pm

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

Post by NotNull » Tue Jul 30, 2019 2:18 pm

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