Hello,
I am trying to figure out how to search only for parent folders of a given name.
The parent:<path> option needs a specific path to work.
What I am looking is to search only for parent folders, in all drives (not a specified path), excluding subfolders of each parent folder.
Is this possible?
Thank you
Search Only for Parent Folders, excluding subfolders
Re: Search Only for Parent Folders, excluding subfolders
So, when you have a C:\MyFolder\MyFile.txt and you search for MyFile, you want it to report C:\MyFolder?
Use
Use
child:myfile
Re: Search Only for Parent Folders, excluding subfolders
File name is irrelevant. I want to search for folders but only the parent and not subfolders.
For example, if I have
C:\My Folder1\Subfolder1\Subfolder2\etc...
D:\My Folder1\Subfolder1\Subfolder2\etc...
and I search for Folder1, I want to return, C:\My Folder1 and D:\My Folder1 excluding any subfolders, just the parent folders of any given folder search.
Can it be done?
Thank you
For example, if I have
C:\My Folder1\Subfolder1\Subfolder2\etc...
D:\My Folder1\Subfolder1\Subfolder2\etc...
and I search for Folder1, I want to return, C:\My Folder1 and D:\My Folder1 excluding any subfolders, just the parent folders of any given folder search.
Can it be done?
Thank you
Re: Search Only for Parent Folders, excluding subfolders
A couple of examples:
Try
This will search for all folders which names end with Folder1
If you have the exact folder nmae, you can search for:
-or-
Try
folder: regex:"Folder1"$
This will search for all folders which names end with Folder1
If you have the exact folder nmae, you can search for:
folder: regex:"\\exact folder name"$
-or-
folder: wfn:"exact folder name"
Re: Search Only for Parent Folders, excluding subfolders
What you have suggested is a very handy search. However is it possible to reverse it to search for folders that begin with a folder name? I don't get the desired results as I am looking for parent folders.
Also the parent folder name might have additional words in it.
For example, I might have
C:\My Folder1 Apples\Subfolder1\Subfolder2\etc...
D:\My Folder1 Apples\Subfolder1\Subfolder2\etc...
So when I search for "My Folder 1", to get only parent folders that have "My folder 1" part of the parent folders name.
In this case it would be
C:\My Folder1 Apples
D:\My Folder1 Apples
-
Another example would be if I have
C:\My Folder1 Apples\Subfolder1\Subfolder2\etc...
D:\My Folder1 Oranges\Subfolder1\Subfolder2\etc...
and search for "My Folder 1", to get as a result
C:\My Folder1 Apples
D:\My Folder1 Oranges\
-
Another example would be if I have
C:\A\My Folder1 Apples\Subfolder1\Subfolder2\etc...
D:\B\My Folder1 Oranges\Subfolder1\Subfolder2\etc...
and search for "My Folder 1", to get as a result
C:\A\My Folder1 Apples\
D:\B\My Folder1 Oranges
I hope I am making sense.
Thank you
Also the parent folder name might have additional words in it.
For example, I might have
C:\My Folder1 Apples\Subfolder1\Subfolder2\etc...
D:\My Folder1 Apples\Subfolder1\Subfolder2\etc...
So when I search for "My Folder 1", to get only parent folders that have "My folder 1" part of the parent folders name.
In this case it would be
C:\My Folder1 Apples
D:\My Folder1 Apples
-
Another example would be if I have
C:\My Folder1 Apples\Subfolder1\Subfolder2\etc...
D:\My Folder1 Oranges\Subfolder1\Subfolder2\etc...
and search for "My Folder 1", to get as a result
C:\My Folder1 Apples
D:\My Folder1 Oranges\
-
Another example would be if I have
C:\A\My Folder1 Apples\Subfolder1\Subfolder2\etc...
D:\B\My Folder1 Oranges\Subfolder1\Subfolder2\etc...
and search for "My Folder 1", to get as a result
C:\A\My Folder1 Apples\
D:\B\My Folder1 Oranges
I hope I am making sense.
Thank you
Re: Search Only for Parent Folders, excluding subfolders
Certainly.
If you want only folders that start with "some text", search for:
Or:
If you want only folders with "some text" anywhere in the name, search for:
Or:
(not tested, but should work)
EDIT:Tested.
If you want only folders that start with "some text", search for:
folder: regex:"\\some text[^\\]*"$
Or:
folder: wfn:"some text*"
If you want only folders with "some text" anywhere in the name, search for:
folder: regex:"\\[^\\]*some text[^\\]*"$
Or:
folder: wfn:"*some text*"
(not tested, but should work)
EDIT:Tested.
Re: Search Only for Parent Folders, excluding subfolders
Thank you for all of the replies.
I tried all suggestions but what worked for me was
folder: folder1 !*folder1*\*
Thank you all for taking the time to help!
I tried all suggestions but what worked for me was
folder: folder1 !*folder1*\*
Thank you all for taking the time to help!