{filepath}

Exactly what sting does this argument send? Is a quotation mark (") automatically supplied on both sides of the path string? Does it add anything extra?

I am using Everything.
voidtools.com/
The starting folder can be specified from command line as follows:

Everything.exe -path {filepath}

In my environment (Opus 9.1.3.0), an extra quatation mark is added at the end when there is a space in the path (e.g. C:\Program Files), and this is fatal for Everything.

A way around this problem is to use {allfilepath} (or %1, %L). There is no extra quotation mark with this. Why the difference? Is this normal?

Both {filepath} and {allfilepath} will automatically quote the string if it contains a space.

You can use @nofilenamequoting to prevent it from happening:

@nofilenamequoting Everything.exe -path {filepath$}

BTW, I used {filepath$} so that the button will do nothing if no files are selected. If you use {filepath} instead then the button will run "Everything.exe -path " if you accidentally click it when nothing is selected.

What I am saying is that the way {filepath} quotes paths does not seem to be right. It gives:

"C:\Program Files""

The extra " at the end is no good for Everything. Is this normal?

And when there is no space, {filepath} quotes fine. For example:

"C:\Temp"

This looks like a bug to me.

I wanted someone to try it and confirm this before I would do something about it.

It shouldn't do that (and never has for me).

How are you verifying what Opus is doing?

I made an MS-DOS Batch Function button which runs this code:

echo {filepath$} pause
If I run it on C:\Temp it prints out [b]C:\Temp[/b]

If I run it on C:\Program Files it prints out "C:\Program Files"

Sometimes the \ which Opus puts at the end of folder paths can confuse programs. If that is the case then you can use noterm to prevent it:

echo {filepath$|noterm} pause
That will print C:\Temp and "C:\Program Files" for the two examples.

Everything (unicode compatible) displays the following with {filepath}.

"C:\Program Files""

"C:\Temp"("C:\Temp" above is a typo)

Is this an encoding bug of a string (with a space) ending backslash?
My Windows locale is not English and, you know, a backslash is mapped to a different symbol in a different locale.

With {filepath|noterm}, everything (not the name of the program) is fine.

I did the same. My DOS window correctly shows "C:\Program Files".

There is another non-DOS, unicode compatible program that is having a problem with {filepath}, so it's not just Everything.

Any idea what is going on? Anyway, I've already filed a report.

PS. It turned out that %1 and %L don't work either. A around this problem in my environment is to use {allfilepath} or {filepath|noterm}.

Given that you seem to have established (via the DOS Command window) that Opus is providing the correct arguments, it looks like your other programs are not parsing the command line properly and adding a spurious " to the line.

You might be better off reporting the "bug" to them.

There's an issue with some programs and quoted paths that end in a , because the " is interpreted as an escaped " character.

Using noterm fixes it.

(The same problem affects my SetClip program which uses the MS C-Runtime to parse command-line arguments. There's a table on that page showing what happens with different \ and " combinations at the end of an argument. I'm not completely sure what is at fault, but it's easily fixed by using noterm in Opus.)

But {allfilepath} works with them, though. With a single path selected, what is the difference between {filepath} and {allfilepath}?

I just checked and {allfilepath} doesn't include the extra \ at the end of folder paths. So it's like {filepath|noterm} and the "noterm" behaviour is by default with it.