Can custom_open_commands / custom_open_command01 support relative path?

Discussion related to "Everything" 1.5.
Post Reply
bytim
Posts: 10
Joined: Sat Jul 20, 2024 12:22 pm

Can custom_open_commands / custom_open_command01 support relative path?

Post by bytim »

For example, my folder structure is like this:
C:\Tools\AppCall\Everything\Everything.exe
C:\Tools\AppCall\TextPdf\EverEdit\EverEdit.exe
PixPin_dopus.exe_2025-08-06_09-52-16.png
PixPin_dopus.exe_2025-08-06_09-52-16.png (22.59 KiB) Viewed 5426 times

I set the custom_open_commands / custom_open_command01 like this:(but it can not be executed.....)
$exec("..\TextPdf\EverEdit\EverEdit.exe" %*)
image.png
image.png (76.77 KiB) Viewed 5426 times

So I have to add a system environment variable %Extools% pointing to "C:\Tools\AppCall", and use this in custom_open_commands:

Code: Select all

$exec("%Extools%\TextPdf\EverEdit\EverEdit.exe" %*)

I hope custom_open_command can support relative path, so that when on another PC, my portable Everything can call "EverEdit.exe" without setting a environment variable.
Or, is there an internal variable ($exepath,‌e.g.) representing the path where everything exe is in?then we can use:

Code: Select all

$exec("$exepath\..\TextPdf\EverEdit\EverEdit.exe" %*)
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: Can custom_open_commands / custom_open_command01 support relative path?

Post by void »

The next alpha update will treat files relative to the exe location.

I will also add a $exepath: variable.

Thank you for the suggestions.
therube
Posts: 5723
Joined: Thu Sep 03, 2009 6:48 pm

Re: Can custom_open_commands / custom_open_command01 support relative path?

Post by therube »

In the picture, Edit Table, that is from dopus?
No.
That is from custom_open_commands (which does have the Edit dialog (where custom_open_command##= does not).


I'll note that if the wanted .exe is within %PATH%, you needn't even include a path.
The .exe name itself is sufficient.

So if PATH=C:\BIN; & you have a program, C:\BIN\CHK.exe,
you can
$exec(CHK.exe %*)
kind of thing (or
$exec(C"\BIN\CHK.exe %*)
).
therube
Posts: 5723
Joined: Thu Sep 03, 2009 6:48 pm

Re: Can custom_open_commands / custom_open_command01 support relative path?

Post by therube »

The next alpha update will treat files relative to the exe location.
Say that again? Files or $exec'd programs? And relative to Everything.exe?

And how will that work?
If a full path is given, a full path is used.
And if a relative path is given, a relative path is used?
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: Can custom_open_commands / custom_open_command01 support relative path?

Post by void »

The first parameter to $exec() is converted to an absolute path relative to your Everything.exe location if it starts with .\ or ..\

If a full path is given, the full path is used.
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: Can custom_open_commands / custom_open_command01 support relative path?

Post by void »

Everything 1.5.0.1397a will now use paths relative to your Everything.exe when calling $exec()
Post Reply