I can not find a way to make ES report filenames and folders in double quotes.
That can of course be added when "post-processing" the results in a script, but an option for that would be welcome.
Alternative:
The -csv option will report filenames in "", but adds a header-line. A -no-header option or similar would do fine too.
Maybe even more useful: that way you can combine multiple queries in 1 EFU/CSV/..
( like es.exe query1 -efu > output.efu followed by es.exe query2 -efu -no-header >> output.efu)
[DONE] ES: double quote filenames/paths
[DONE] ES: double quote filenames/paths
Last edited by NotNull on Wed Oct 23, 2019 4:22 pm, edited 1 time in total.
Re: ES: double quote filenames/paths
ES 1.1.0.16
-no-header
- Added -no-header command line option
- Added -double_quote -double-quote command line option
- Added -version command line option
- Added -get-everything-version command line option
-no-header
-double-quoteDo not output a column header for CSV and EFU files.
-versionWrap paths and filenames with double quotes.
-get-everything-versionDisplay ES major.minor.revision.build version and exit.
Display Everything major.minor.revision.build version and exit.
Re: ES: double quote filenames/paths
That's quick!
BTW: -double_quote should be -double-quote
With that new options, you can check for - for example - the Everything version like this:
PowerShell
CMD
CMD doesn't have some embedded version comparison functionality, so one has to write it.
Note1: this is made specifically for Everything /ES : Always x.x.x.x numbering (only numbers) and no prefix zero's (like 1.05.01.123).
If Everything versioning scheme ever changes, this code has to change too.
Note2: Script uses Major Minor Build Revision version scheme, whereas these options use Major Minor Revision Build scheme. Doesn't matter for the outcome; end result will be the same.
Works like a charm!
BTW: -double_quote should be -double-quote
Are you clairvoyant? Both were on my list of "ask later suggestions". I had even written the code to compare versions already ...
- Added -version command line option
- Added -get-everything-version command line option
With that new options, you can check for - for example - the Everything version like this:
PowerShell
Code: Select all
if ([Version](es.exe -get-everything-version) -lt [Version]"1.4.1.934") {echo Everything version too old}
CMD doesn't have some embedded version comparison functionality, so one has to write it.
Note1: this is made specifically for Everything /ES : Always x.x.x.x numbering (only numbers) and no prefix zero's (like 1.05.01.123).
If Everything versioning scheme ever changes, this code has to change too.
Note2: Script uses Major Minor Build Revision version scheme, whereas these options use Major Minor Revision Build scheme. Doesn't matter for the outcome; end result will be the same.
Code: Select all
@echo off
setlocal enabledelayedexpansion
:: Check against version ...
set REFERENCE=1.4.1.877
:: INIT
set CHECK=0.0.0.0
set RESULT=
::__________________________________________________
::
:: ACTION!
::__________________________________________________
::
:: Split REFERENCE version in Major Minor Build Revision
for /f "tokens=1-4 delims=." %%i in ("%REFERENCE%") do (
set /a REFERENCE[0]=%%i, REFERENCE[1]=%%j, REFERENCE[2]=%%k, REFERENCE[3]=%%l
)
:: Get current version (%CHECK%)
for /f "usebackq delims=" %%x in (`es.exe -get-everything-version`) DO set CHECK=%%x
:: Split CHECK version in Major Minor Build Revision
for /f "tokens=1-4 delims=." %%i in ("%CHECK%") do (
set /a CHECK[0]=%%i, CHECK[1]=%%j, CHECK[2]=%%k, CHECK[3]=%%l
)
:: Compare each part (if needed)
for /l %%i in (0,1,3) do call :COMPARE !REFERENCE[%%i]! !CHECK[%%i]!
if not defined RESULT set RESULT=same version
echo %COMPARE% is a %RESULT% than %REFERENCE%
goto :EOF
::___________________________________________________
::
:COMPARE [REFERENCE[n] CHECK[n]
::___________________________________________________
::
if defined RESULT goto :EOF
if %1 gtr %2 set RESULT=older version
if %1 lss %2 set RESULT=newer version
goto :EOF
Re: ES: double quote filenames/paths
Fixed, thanks.BTW: -double_quote should be -double-quote
I had these on my TODO list for some time now.Are you clairvoyant? Both were on my list of "ask later suggestions". I had even written the code to compare versions already ...
Would it be helpful to add -version-major, -version-minor, -version-revision and -version-build?
This might make comparison easier, you could just use the build number.
Same with -get-everything-version-major, -get-everything-version-minor...
Re: ES: double quote filenames/paths
Not as far as I am concerned. I saw these in the SDK when "researching" this version stuff. Thought about it and concluded that it wasn't worth the trouble (it can easily be deducted from the complete version).
If anything, something like -require-everything-version 1.4.1.877 -minimum-everything-version 1.4.1.877 and -require-es-version 1.1.0.11 -minimum-version 1.1.0.11 would be more practical.
On the other hand: the only time I really needed to check for the version, was when you implemented the -getresultcount fix in build 947.
Long story short: I'm good Very happy with the current state of ES. (it has grown into being one of my favourite tools)