How to find all instances of an exact file name Revisited

Discussion related to "Everything" 1.5 Alpha.
Post Reply
SuperDude
Posts: 221
Joined: Thu Sep 25, 2014 7:57 pm

How to find all instances of an exact file name Revisited

Post by SuperDude »

I've asked this question before, but I still can't figure out how to make Everything find and display only an exact selected file name when activating a search via a hotkey.

I have tried these two search command-lines, both which yield the same results:

Everything64.exe -name-part exact:"%1" -s file:
Everything64.exe -name-part "%1" -s file:


If I select a file, for example, Everything64.exe (in Directory Opus), then activate my hotkey, Everything finds all instances of Everything64.exe, but it also finds other files with Everything64.exe in their names. If I then type exact: in front of the word Everything64.exe (in the search edit field), then just all instances of the search term (Everything64.exe) is shown, which is what I want to happen.

I would really appreciate any help with this problem, as it's driving me crazy. Thank you!
NotNull
Posts: 5330
Joined: Wed May 24, 2017 9:22 pm

Re: How to find all instances of an exact file name Revisited

Post by NotNull »

the following should do it (the order of the parameters is important):

Code: Select all

Everything.exe   -search file:   -name-part %1

(And please don't go crazy; if only because your contributions are too valuable for that to happen :D )
SuperDude
Posts: 221
Joined: Thu Sep 25, 2014 7:57 pm

Re: How to find all instances of an exact file name Revisited

Post by SuperDude »

@NotNull

Thank you for replying! Unfortunately, the command you gave me only works for some words: Sometimes only the search word is found, but then other times I get what I'm looking for, plus files with my search word in their names. I did try this command:

Everything64.exe -search exact: -name-part "%1" —> If I search for, say, Everything64.exe, the search box then shows this:

exact: "Everything64.exe" <— Note the space between exact: and the first quotation mark. If I manually remove that space, all instances of only the file I am looking for appear in the search results list. I can't seem to find a way to structure the command so it removes that space automatically, so it will show exact:"Everything64.exe" in the search box (minus the space).

Thanks for your help!
therube
Posts: 4679
Joined: Thu Sep 03, 2009 6:48 pm

Re: How to find all instances of an exact file name Revisited

Post by therube »

I'm thinking he's looking for wfn: (-wfn) [& most likely combined with -no-matchpath], but there is no such option?

How do you quote -regex
^everything64.exe$
to get it to parse correctly?
NotNull
Posts: 5330
Joined: Wed May 24, 2017 9:22 pm

Re: How to find all instances of an exact file name Revisited

Post by NotNull »

Can you give an example where this doesn't work?
Here it works every time. Let's say I have a file "C:\Tools\Everything\Run History.csv".
That ends up as the following in the Everything search bar:

Code: Select all

file: nopath:wfn:"Run History.csv" 
(Everything 1.4, btw. I assume you used 1.4 too as this wasn't posted in the 1.5 forum)

Maybe you need "" around %1 in your solution? ("%1" instead of %1)
therube
Posts: 4679
Joined: Thu Sep 03, 2009 6:48 pm

Re: How to find all instances of an exact file name Revisited

Post by therube »

(I'm messing with 1.5...)

Oh.
everything -instance 15 -regex -s ^everything64.exe$


So you set -regex, then set a seach term (-s).
(Before I was trying stuff like; -regex "^everything64.exe$".)
SuperDude
Posts: 221
Joined: Thu Sep 25, 2014 7:57 pm

Re: How to find all instances of an exact file name Revisited

Post by SuperDude »

@NotNull:

I goofed. I thought this was the Everything 1.5 Alpha support forum. Should I re-post this thread there?
NotNull
Posts: 5330
Joined: Wed May 24, 2017 9:22 pm

Re: How to find all instances of an exact file name Revisited

Post by NotNull »

Not needed; I will move this entire thread over there.
(The everything64.exe instead of everything.exe should have given me enough clues, but I missed those :))

For 1.5, you can use:

Code: Select all

Everything64.exe   -search file:   #filename:%1
*(will depend if your sulution "" the filename or not. If not, use "%1"
NotNull
Posts: 5330
Joined: Wed May 24, 2017 9:22 pm

Re: How to find all instances of an exact file name Revisited

Post by NotNull »

For a quick test, add a context menu entry for this:
(change the Everything path if necessary)

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Classes\*\Shell\SearchThisFile]
"Icon"="\"c:\\Program Files\\Everything 1.5a\\Everything64.exe\",0"
"MUIVerb"="Search this file in Everything"

[HKEY_CURRENT_USER\SOFTWARE\Classes\*\Shell\SearchThisFile\Command]
@="\"c:\\Program Files\\Everything 1.5a\\Everything64.exe\" -search file: #filename:\"%1\""

(Officially, the ffilename should be in <>, but it works well without, so I took the shortcut ...)


EDIT:

To "Uninstall":

Code: Select all

Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\SOFTWARE\Classes\*\Shell\SearchThisFile]

SuperDude
Posts: 221
Joined: Thu Sep 25, 2014 7:57 pm

Re: How to find all instances of an exact file name Revisited

Post by SuperDude »

@NotNull:

Man, you are so helpful! Thank you. I will try out your registry key and will get back to you. Thanks again :)
therube
Posts: 4679
Joined: Thu Sep 03, 2009 6:48 pm

Re: How to find all instances of an exact file name Revisited

Post by therube »

If the intent is wfn: (?) that still doesn't do it.

everything -instance 15 -s #filename:everything.exe

finds:
Everything.exe
Everything.exe.10544.dmp
hddb-1.4.4.x86 (everything).exe
...


(Oh, I've got !PUNC: enabled so that's why the hddb... is found.)

---

If you want wfn:, then something like this should do it:
Everything.exe -instance 15 -regex -s "^%~n1%~x1$"
SuperDude
Posts: 221
Joined: Thu Sep 25, 2014 7:57 pm

Re: How to find all instances of an exact file name Revisited

Post by SuperDude »

@therube:

Thank you for replying. I modified the command you showed me, like this:

Everything64.exe -s #filename:"%1"

Now, if I search for BOOKMARKS-1.5a.CSV —> Everything finds all instances of BOOKMARKS-1.5a.CSV but it also finds other files, like Backup “BOOKMARKS-1.5a.CSV”.exe and Backup EVERYTHING-1.5a.INI and BOOKMARKS-1.5a.CSV.rar etc. If I can just find a command that will only find BOOKMARKS-1.5a.CSV (on all drives) while ignoring the other files...
NotNull
Posts: 5330
Joined: Wed May 24, 2017 9:22 pm

Re: How to find all instances of an exact file name Revisited

Post by NotNull »

Strange that it doesn't work with the both of you. Here the command is translated to the following in the Everything searchbar:
exact:"everything.exe" file:

and that reports only files with the exact name everything.exe
SuperDude
Posts: 221
Joined: Thu Sep 25, 2014 7:57 pm

Re: How to find all instances of an exact file name Revisited

Post by SuperDude »

@NotNull:

I'm getting close (I think) to getting this. I'm now using this command:

D:\Everything64\Everything64.exe -s #filename:"%1"

When searching for Everything64.exe with this command, I get this as output: Everything64.exe plus any other files with Everything64.exe in their names. If I then just type exact: in front of Everything64.exe (in the search box), everything except Everything64.exe gets filtered out, which is what I'm after. Note that there is no file: in the output, which is cleaner, IMO.
NotNull
Posts: 5330
Joined: Wed May 24, 2017 9:22 pm

Re: How to find all instances of an exact file name Revisited

Post by NotNull »

What happens with:

D:\Everything64\Everything64.exe -s exact:#filename:"%1"

(the file: is needed to eliminate folders named "everything.exe" or when you search for a file "hosts" and don't want to find folders with the same name.
SuperDude
Posts: 221
Joined: Thu Sep 25, 2014 7:57 pm

Re: How to find all instances of an exact file name Revisited

Post by SuperDude »

@NotNull:

This is weird. Your command (D:\Everything64\Everything64.exe -s exact:#filename:"%1") is able to find:

Everything64.exe
EVERYTHING-1.5a.INI
BOOKMARKS-1.5a.CSV


... but it is unable to find:

Everything v1.5.0 Alpha [64-bit] — Resource Hacker MOD.exe
Everything v1.5.0 [64-bit] ALPHA — Column Headers.jpg
Everything v1.5 ▬ START SERVICE.lnk
Everything v1.5 ▬ STOP SERVICE.lnk


etc.

Thank you for your help. I don't want to waste any more of your time. Maybe David can figure this out?
therube
Posts: 4679
Joined: Thu Sep 03, 2009 6:48 pm

Re: How to find all instances of an exact file name Revisited

Post by therube »

Here the command is translated to the following in the Everything searchbar:
are you saying that
exact:"everything.exe" file:

should equal
Everything64.exe -search file: #filename:%1


Because that is not the case, from what I can tell.
(Heh. I didn't realize that exact: & wfn: were synonyms.)

exact: (wfn:) returns results with names containing exactly what is searched for
(path: will affect that, cause it will then consider the path part in determining "exact")

#filename:%1, limits the searched for string to the name part of a path+name, but results are not constrained to be an exact match


Given that exact: (wfn:) does not seem to be available from the command line, the only way I see to get a similar result is with regex:.


Do note, that depending on what you search for #filename:%1 may happen to return same results as exact: does - but that needn't be the case & does not mean they are equal (they are not).


---


Heh.

Didn't realize you added,
-s exact:#filename:"%1"

That should be fine.
With exact: being wfn:, & #filename: equating to "^%~n1%~x1$".

Likewise,
Given that exact: (wfn:) does not seem to be available from the command line
- is wrong, because it is!
(It just didn't show up in the Command Line Options help, so I just took it, incorrectly, to not being available.)
therube
Posts: 4679
Joined: Thu Sep 03, 2009 6:48 pm

Re: How to find all instances of an exact file name Revisited

Post by therube »

At Super,

In one instance, you wanted "exact":
BOOKMARKS-1.5a.CSV, & not, BOOKMARKS-1.5a.CSV.rar


And later, you want not-exact:
(not quite sure what your search was, perhaps, 'everything' ?)

From what you have listed, exact:#filename:everything, should not have returned anything.
A simple search for, everything, would have returned all that you have shown.

If %1 were a directory path (with no file name), it would return files & directories containing the name of the last segment of the path. So,
exact:#filename:C:\tmp\
(where C:\tmp\ is a directory name) would return files or directories named, "tmp".
NotNull
Posts: 5330
Joined: Wed May 24, 2017 9:22 pm

Re: How to find all instances of an exact file name Revisited

Post by NotNull »

therube wrote: Mon Jul 26, 2021 7:23 pm are you saying that
exact:"everything.exe" file:

should equal
Everything64.exe -search file: #filename:%1
Exactly! ;)



2021-07-26 21_49_24-.png
2021-07-26 21_49_24-.png (76.17 KiB) Viewed 30527 times
SuperDude
Posts: 221
Joined: Thu Sep 25, 2014 7:57 pm

Re: How to find all instances of an exact file name Revisited

Post by SuperDude »

therube wrote: Mon Jul 26, 2021 7:23 pm
Here the command is translated to the following in the Everything searchbar:
are you saying that
exact:"everything.exe" file:

should equal
Everything64.exe -search file: #filename:%1


When I try using your command: D:\Everything64\Everything64.exe -search file: #filename:%1

The following shows up in the search box: "#filename:D:\Everything64\Everything64.exe" file:

I really appreciate you guys for being so helpful, but I don't want you to waste any more time on this. Thanks to everyone!
therube
Posts: 4679
Joined: Thu Sep 03, 2009 6:48 pm

Re: How to find all instances of an exact file name Revisited

Post by therube »

I can't dup?

Code: Select all

everything -instance 15 -search file: #filename:"C:\USR\STEVEN\P\out3.mp4" -debug

Code: Select all

Everything
Version 1.5.0.1269a (x86)
Windows NT 6.1
Processors 8
IsAdmin 0
AppData 0
Service 1
cmdline .\everything.exe  -instance 15
ui show
cache for  \ #filename:C:\USR\STEVEN\P\out3.mp4 not found
listview message 78 00002719 0018ee80
listview message 78 00002719 0018ee80
CBT: 5 023006ce 0018f3f8
listview message 133 00000001 00000000
listview message 20 0b01246f 00000000
WM_ACTIVATE 00000001 00000000, lastfocus 010c02b0, current focus 00000000
FOCUS 0
FOCUS restore
CBT: 9 010c02b0 00000000
CBT: 9 023006ce 010c02b0
add nav "out3.mp4" file:
CBT: 9 010c02b0 023006ce
update search 1
add nav "out3.mp4" file:
search '"out3.mp4" file:' filter '' sort 0 ascending 1
void
Developer
Posts: 15663
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to find all instances of an exact file name Revisited

Post by void »

-search expects a single parameter.

Use -search* to treat the rest of the command line as the search.

For example:
everything -instance 15 -debug -search* file: #filename:"C:\USR\STEVEN\P\out3.mp4"

The preprocessor currently only expands search text.

The next alpha update will also apply the preprocessor to filename parameters.
This will make the following work:
everything -instance 15 -search file: #filename:"C:\USR\STEVEN\P\out3.mp4" -debug
void
Developer
Posts: 15663
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to find all instances of an exact file name Revisited

Post by void »

Everything 1.5.0.1270a adds support for preprocessor-expanding filenames passed on the command line.
therube
Posts: 4679
Joined: Thu Sep 03, 2009 6:48 pm

Re: How to find all instances of an exact file name Revisited

Post by therube »

@NotNull

In your screenshot, is the command line that you show, what generated the GUI (response) & associated debug log?
NotNull
Posts: 5330
Joined: Wed May 24, 2017 9:22 pm

Re: How to find all instances of an exact file name Revisited

Post by NotNull »

Yes.
therube
Posts: 4679
Joined: Thu Sep 03, 2009 6:48 pm

Re: How to find all instances of an exact file name Revisited

Post by therube »

Next question then...

Why do I get differing results (i.e., no exact: displaying in the GUI nor debug log) compared to what you're getting?
NotNull
Posts: 5330
Joined: Wed May 24, 2017 9:22 pm

Re: How to find all instances of an exact file name Revisited

Post by NotNull »

Don't know yet (assuming that you used the exact same command-line).
Will look at it this weekend.
Post Reply