Run a file to search a predefined query

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
koolestani
Posts: 49
Joined: Wed Feb 12, 2020 5:03 am

Run a file to search a predefined query

Post by koolestani »

Hello

I was wondering if I can create a file which, upon running, opens/searches a predefined query, with various settings turned on/off as intended.

Example

"D:\Folder" endwith: file.txt
[WHOLE WORD ON] [PATH OFF]

Just to be clear, only the query is predefined, the results this query yields will be fetched live (when the file is run).
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Run a file to search a predefined query

Post by void »

Create a shortcut to Everything.exe with the following target:

"C:\Program Files\Everything\Everything.exe" -wholeword -nomatchpath -s """"D:\Folder""" endwith: file.txt"

""" = a single literal double quote.
-wholeword = enable whole words.
-nomatchpath = disable match path.
-s = specify the search.

Command Line Options
koolestani
Posts: 49
Joined: Wed Feb 12, 2020 5:03 am

Re: Run a file to search a predefined query

Post by koolestani »

Thanks
Can this be detailed in further by defining the view of the results as Extra Large Icons and Document filter to be applied?
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Run a file to search a predefined query

Post by void »

add:
-thumbnails -thumbnail-size 256 -filter "document"

"C:\Program Files\Everything\Everything.exe" -wholeword -nomatchpath -thumbnails -thumbnail-size 256 -filter "document" -s """"D:\Folder""" endwith: file.txt"
koolestani
Posts: 49
Joined: Wed Feb 12, 2020 5:03 am

Re: Run a file to search a predefined query

Post by koolestani »

Ooof, this turned out to be yet another layer of syntax.
I see the documentation you shared in the previous reply isn't exhaustive then. Can it be updated to include every possible option?
Thanks for the quick save!
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Run a file to search a predefined query

Post by void »

All available command line options are listed in Command Line Options.

-wholeword
-nomatchpath
-thumbnails
-thumbnail-size
-filter
-s
koolestani
Posts: 49
Joined: Wed Feb 12, 2020 5:03 am

Re: Run a file to search a predefined query

Post by koolestani »

Is there a way to use relative path with respect to where the shortcut is located and the location for which the search needs to be performed?
In my case the search needs to be performed in a directory which is one level up, relative to the location of the shortcut file.
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Run a file to search a predefined query

Post by void »

Set the shortcut "Start in" and use relative paths with -path

For example:
start in: C:\Windows\system32
target: C:\Program Files\Everything\Everything.exe -path ".."

Search is set to:
"C:\Windows\"

-path
koolestani
Posts: 49
Joined: Wed Feb 12, 2020 5:03 am

Re: Run a file to search a predefined query

Post by koolestani »

This isn't what I was expecting. It's like making it relative but not before using an absolute path to do that which defeats the original intent.
Is there perhaps a way to run a search in the folder containing the shortcut file itself using some meta tag or path information of the shortcut.
I'm basically trying to reduce the "dependency" of absolute path from the shortcut so that it becomes "portable" so to speak.
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Run a file to search a predefined query

Post by void »

Might be doable with a BAT file:

Code: Select all

"C:\Program Files\Everything\Everything.exe" -path ".."


es: url protocol is another option. (.url file)
Unfortunately, you would need to write out absolute paths again..



Everything 1.5 will let you rewrite your searches with the Everything preprocessor.
Unfortunately, this doesn't help with portability and launching Everything from a shortcut.
Post Reply