ES 1.1 Command Line Tool for Everything 1.4.1

General discussion related to "Everything".
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1.0.1 Alpha Command Line Tool for Everything 1.4.1

Post by void »

Thanks for your post.
Test 1. ES command line
es.exe -export-efu C:\es_test.efu C:\
Result: ~35 seconds 90MB output file
Results are from the Everything index.
This is slowest method, because:
1) All file information is gathered
2) WM_COPYDATA used for IPC is slow.
Test 2. Everything.exe command line
Everything.exe -create-file-list C:\ev_test.efu C:\
Results are scanned from disk. Not the Everything index.
Permissions may limit some files from scanning.
Reparse points are followed, whereas ES does not.
All file information is gathered.
Test 3: Everything GUI menu
Everything GUI: first search C:\ and then go to menu > file > export
Results are from the Everything index.
Only indexed file information or cached file information is exported.

I've modified ES 1.0.0.9 to be consistent with Everything.
That is ES -export-efu will now only export information that is indexed.
You can use -size, -date-modified, -date-created and/or -attributes to override this behavior.

ES 1.0.0.9

Changes:
  • fixed an issue with checking if the database is loaded.
  • exporting as efu only exports indexed information now, use -size, -date-modified, -date-created or -attributes to override.
  • folder size is also exported now.
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1.0.10 Command Line Tool for Everything 1.4.1

Post by void »

ES-1.1.0.10.zip
  • -r and -regex now take a parameter.
  • Everything now handles regex escape sequences.
ovg
Posts: 294
Joined: Thu Oct 27, 2016 7:19 pm

Re: ES 1.1.0.10 Command Line Tool for Everything 1.4.1

Post by ovg »

Link leads to 404 Error ...
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1.0.10 Command Line Tool for Everything 1.4.1

Post by void »

Fixed link.
ovg
Posts: 294
Joined: Thu Oct 27, 2016 7:19 pm

Re: ES 1.1.0.10 Command Line Tool for Everything 1.4.1

Post by ovg »

Thanks!
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1.0.10 Command Line Tool for Everything 1.4.1

Post by void »

ES-1.1.0.12.zip
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

ES-1.1.0.13
  • added -cd -removed -cd -added -ipc1 -ipc2 -output errors to std_error
ES-1.1.0.14
  • updated help (thanks to NotNull) and fixed -? -h -help errors
ES-1.1.0.15
  • updated help (thanks to NotNull)
ES-1.1.0.16
  • added -no-header, added -double-quote, added -version, added -get-everything-version
ES-1.1.0.17
  • added -no-result-error
ES-1.1.0.18.zip
  • Added -get-total-size command line option to return the total file size of all results.
cmartx
Posts: 1
Joined: Sat May 09, 2020 12:36 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by cmartx »

Hi, Greetings from Sydney. I'm a casual user of everything (including the new 1.4.1 version) and I've recently gone to the command line to look for specific searches to capture output from. I've looked a the documentation fairly closely and I can't see any way of searching for files modified on a certain date or younger than a certain date. I can do it in the GUI (i.e. dm:1/5/2020 ) but is there a way to do it from the command line? All the best.
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

es uses the same syntax as Everything.
Just remember to escape < > ^ and | with ^

For example, find files modified on the 1/5/2020, search for:
ES.exe dm:1/5/2020

For example, find files modified after 1/5/2020, search for:
ES.exe dm:^>1/5/2020

For example, find files modified between 1/5/2020 and 8/5/2020, search for:
ES.exe dm:1/5/2020..8/5/2020

Include -dm to show the date modified in your ES results.
Include -sort dm to sort your results by date modified.
nspp
Posts: 10
Joined: Tue Oct 27, 2020 8:57 am

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by nspp »

I have made a try with version 1.1.0.19 ant it seams that single [ctrl]+C signal is not effective and does not stop the process immediately. Could it be possible to not list all folder if no parameter are provided.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by NotNull »

nspp wrote: Wed Nov 04, 2020 12:58 pm Could it be possible to not list all folder if no parameter are provided.
Yes. You can specify what ES should do if there are no parameters.
Those settings will be stored in ES.ini, in the folder where your ES.exe is.

Option 1: Do nothing

Code: Select all

ES.exe  -hide-empty-search-results -save-settings

Option 1: Show Help text

Code: Select all

ES.exe -empty-search-help -save-settings

(Not very relevant - and not a recommended solution - but I configured it as ES.exe -n 10 -save-settings , so that I also have a quick check to see if Everything is running/ reachable. )
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by NotNull »

From the opening post:
Saving and clearing settings

-save-settings

Save all switches to the registry under HKEY_CURRENT_USER\Software\ES

-clear-settings

Clear all saved settings in the registry under HKEY_CURRENT_USER\Software\ES

Is that still Everything 1.3 related? 1.4 saves it's settings in ES.ini
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by NotNull »

Is there a way to not show the filename?

In a recent forum thread I wanted to list all file extensions, but could not get it done without the filename.
No big deal of course, as there are many ways to iron that out.

Just curious if I missed something (there is no command-line switch -no-name, which was my first guess)
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by therube »

(When I looked, I also didn't find a way to omit the name.)
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

ES will always show the name column or full path and name column.

There is currently no option to disable this column.


Pressing Ctrl + C will break the ES request and terminate the current search query. (if you run ES with out any parameters and don't want all results)
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by NotNull »

OK. Thanks!
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

klim
Posts: 13
Joined: Sun Feb 17, 2013 8:09 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by klim »

void wrote: Wed Jan 12, 2022 12:39 am ES-1.1.0.22.zip
Thanks for fast fix, but there is a problem with that version.

es.exe
Error 8: Everything IPC window not found. Please make sure Everything is running
.
horst.epp
Posts: 1447
Joined: Fri Apr 04, 2014 3:24 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by horst.epp »

klim wrote: Wed Jan 12, 2022 9:01 am
void wrote: Wed Jan 12, 2022 12:39 am ES-1.1.0.22.zip
Thanks for fast fix, but there is a problem with that version.

es.exe
Error 8: Everything IPC window not found. Please make sure Everything is running
.
Confimed
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

Thank you for the bug report.

ES-1.1.0.23.zip
  • fixed an issue with ES-1.1.0.22 using the wrong instance name.
horst.epp
Posts: 1447
Joined: Fri Apr 04, 2014 3:24 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by horst.epp »

I would like to have an option for the -txt switch in es
similar to the GUI option /txt_folder_append_path_separator=1
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

I have put on my TODO list to add a -folder-append-path-separator command line option.

Thank you for the suggestion.
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

ES-1.1.0.24.zip
  • fixed a crash when reading es.ini.
Kennor
Posts: 2
Joined: Tue Aug 02, 2022 5:06 am

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by Kennor »

Hi! Is there a option to get the hash value? such as MD5, SHA-256? thank.
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

Not yet, sorry.

This is on my TODO list for Everything 1.5.
Kennor
Posts: 2
Joined: Tue Aug 02, 2022 5:06 am

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by Kennor »

OK, thanks for the tool!
shawnkhall
Posts: 7
Joined: Tue Feb 16, 2021 2:57 am

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by shawnkhall »

1.1.0.24 doesn't have the correct version assigned in the file properties. It does in the about information, but the version at the file properties is still 1.1.0.23.

Code: Select all

###>es /?
ES 1.1.0.24
ES is a command line interface to search Everything from a command prompt.
ES uses the Everything search syntax.
...

Code: Select all

###>filever es.exe
--a-- W32i   APP ENU        1.1.0.23 shp    125,576 08-01-2022 es.exe
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by therube »

(Confirmed.)
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

Thanks for the bug report.

ES-1.1.0.24.zip
  • fixed the version number in the exe details.
shawnkhall
Posts: 7
Joined: Tue Feb 16, 2021 2:57 am

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by shawnkhall »

thank you!
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

ES-1.1.0.25.zip
  • added -exit option to exit the main Everything UI process.
  • added -reindex option rebuild the index.
  • added -utf8-bom option to write a UTF-8 byte order mark at the start of the export file.
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

ES-1.1.0.26.zip
  • fixed an issue with exporting Unicode characters outside plane 0.
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by therube »

es.exe -n 1 -gettotalsize

Is it expected that -gettotalsize gives the total size results of the -n 1 items only, or globally on all returned results (exclusive of -n 1)?
es.exe distinct:

Would it be expected to be able to negate a Function?
Was looking to create a batch file with distinct:, but wanting to also allow myself to !distinct: by manually including !distinct: on the command line.

So my batch, SSS.bat, file reads
es.exe distinct: %*
so I would like to type something like:
C:\> SSS.bat !distinct: Halloween
(or -no-distinct:).

And while we're at that, just what is
!distinct:
doing?
(And I'm now wonder if my unexpected results are not just - me?!)
(I think I'll need to look a bit closer at what I'm actually seeing...)
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

es.exe -n 1 -gettotalsize

Is it expected that -gettotalsize gives the total size results of the -n 1 items only, or globally on all returned results (exclusive of -n 1)?
Everything will still perform the full search and return all the results to the IPC server.
The IPC server will only send 1 result to the IPC client (ES)

Currently, -gettotalsize will ignore -n <n>



Include count:<n> in your search to limit your search to n results.
This parameter is passed to the Everything Search engine, where as -n is not.

es.exe count:1 -gettotalsize


es.exe distinct:

Would it be expected to be able to negate a Function?
Was looking to create a batch file with distinct:, but wanting to also allow myself to !distinct: by manually including !distinct: on the command line.
Everything appears to be returning the expected results for me.
What results are you seeing? expecting?

distinct: will remove any additional duplicate items. (first duplicate remains in the results)
!distinct: will show only duplicate items (without showing the first duplicate)

!distinct: is not very useful.

Maybe you want dupe: instead of distinct: ?
dupe: will show only duplicate items (including the first duplicate)

Also consider unique:
unique: shows files/folders where there are no duplicates at all.
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by therube »

Is there a benefit to be able to save ES results to an Environment Variable?

ES -EVE Thick as a brick

-EVE: store results in the Environment Variable, EVE

C:\> ECHO %EVE%
Jethro Tull - Thick as a brick.m4a


---

Where I think I'm wanting to go is to be able to pipe ES results to a program.
So something like
ES "thick as a brick" | ffplay.exe -


But...

Windows is brain-dead with pipes.
And places where pipes do work, like ffplay.exe, would be looking for a file stream rather then a file name.

So, if you set an environment variable you could "batch" that to a program.
ES -EVE "thick as a brick"
ffplay.exe %EVE%
(or even START %EVE, in this case)

Likewise, you could fire up some "distant" program from the command line.
ES -EVE freefilesync.exe
START %EVE% ...
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

The option to save to an environment variable would be useful.
In some cases it's difficult to call es and pipe the data to an environment variable.

How would you like Everything to store multiple results?
Most other environment variables are semicolon delimited (;)

or, do I force count:1 / -n 1

Environment variable have a size limit of 32KB.



BAT file to store the ES output to the EVE1 environment variable:

Code: Select all

SETLOCAL ENABLEDELAYEDEXPANSION
SET count=1
FOR /F "tokens=* USEBACKQ" %%F IN (`ES.exe %*`) DO (
  SET EVE!count!=%%F
  SET /a count=!count!+1
)
ECHO %EVE1%
ECHO %EVE2%
ECHO %EVE3%
ENDLOCAL
The problem here is the environment variables are lost after the BAT call returns.
horst.epp
Posts: 1447
Joined: Fri Apr 04, 2014 3:24 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by horst.epp »

I don't see any benefit to store es results in environment variables.
Its easy to pipe the results into an output file
and add the necessary chcp.
Then there is no limit in the amount of results and they are available after the bat is finished.

Code: Select all

chcp 65001
set file=C:\Tools\wincmd\scripts\results\Everything.txt
C:\Tools\Everything\es.exe %* >"%file%"
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by therube »

Yes, that was also one of my thoughts.
And yes, I'd have to either be somewhat specific in my search, or limit the results returned (to even 1), or to throw in a "picker" (to pick the desired results, from a GUI [not Everything] window).
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by NotNull »

therube wrote: Wed Nov 30, 2022 7:57 pm Is there a benefit to be able to save ES results to an Environment Variable?
ES is started as a child-process of CMD.exe (or similar) and can not change the envoironment of it's parent (CMD), so changed/new/removed environment will be lost when ES.exe exits.

void wrote: Wed Nov 30, 2022 9:16 pm The problem here is the environment variables are lost after the BAT call returns.
Typically these are not lost. The Setlocal/Endlocal put them in a "sandbox" and that is gone after the batchfile exits.
Without Setlocal, the environment variable will still be 'alive'
The way to handle this *with* Setlocal:

Code: Select all

Setlocal
  set __test1=something
  set __test2=whatever
Endlocal & set __test2=%__test2%
__test2 is available afterwards in CMD (untested)

That works because CMD is a line interpreter, meaning an eentire line gets parsed before executing.
Things get ugly when "exporting" many environment vriables, btw.
kur
Posts: 2
Joined: Wed Apr 12, 2023 12:17 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by kur »

Hello void,

"-inc-run-count" for files its OK,
"-inc-run-count" for folder doesn't work for me,

es version 1.1.0.26
everything version 1.5.0.1340a (x64)

Thank you for everything.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by NotNull »

Pleas show the commands you were using.
Don't put a \ at the end of the foldernmae.

This works here:

Code: Select all


T:\>es -version
1.1.0.19

T:\>es -geteverythingversion
1.5.0.1342

T:\>es -get-run-count "c:\Program Files (x86)"
3
T:\>es -inc-run-count "c:\Program Files (x86)"

T:\>es -get-run-count "c:\Program Files (x86)"
4
T:\>

kur
Posts: 2
Joined: Wed Apr 12, 2023 12:17 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by kur »

Work, Thanks!
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

ES-1.1.0.27.x86.zip
ES-1.1.0.27.x64.zip
  • improved redirected output performance.
  • added x64 build
  • added -cp 65001 to specify redirect code page.
shawnkhall
Posts: 7
Joined: Tue Feb 16, 2021 2:57 am

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by shawnkhall »

When do you anticipate this version will be promoted to stable and distributed from the Downloads page?
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

Updated /downloads/, thank you.
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

ES-1.1.0.28.x86.zip
ES-1.1.0.28.x64.zip
  • Treat a single - as literal instead of as an invalid switch.
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: ES 1.1 Command Line Tool for Everything 1.4.1

Post by void »

ES-1.1.0.29.x86.zip
ES-1.1.0.29.x64.zip
  • -double-quote will now work with TSV/CSV.
  • TSV will avoid quoting by default.
  • CSV will continue to quote by default.
  • TSV/CSV will ignore -double-quote and use quotes if required (string value contains a separator, newline or double quote)
Post Reply