binocular222 wrote:The rule is: the run command should look like this:
run "XX"
Where XX is a path. If XX contain space, then it should be double-quoted like this:
""<path>""
Combining the 2 above, we have triple quote:
run """<path>"""
I'd say: this isn't really correct! To understand: try to use "basic" rules.
The operand of the XY-run-cmd is a string. This string contains a Windows-Command, and optionally parameters for that command. Both are blank-separated, so Windows

cannot distinguish a blank inside the command from blanks to separate multiple parameters. To help Windows you must
deliver the command quoted:
"<xyscripts>\patch (Classic).exe"
Let me build this, in a basic way, using XY syntax:
Code: Select all
$wincmd = '"' . <xyscripts> . '\patch (Classic).exe' . '"';
run $wincmd;
You see: I specified all strings in *single* quotes - so that included variable names would *not* be resolved, and double quotes can simply be included. (If there were single quotes inside, *these* would have to be doubled.) The 3 dots concatenate the 4 strings to one.
Here you *might* combine the last 2 strings to one:
'\patch (Classic).exe"' -> both are identical.
With all outer *double* quotes the same(!) would be (note the doubled double-quotes):
Code: Select all
$wincmd = """" . <xyscripts> . "\patch (Classic).exe" . """";
run $wincmd;
As a variable (here: <xyscripts>) is resolved inside *double* quotes, now all strings can be combined into one:
Code: Select all
$wincmd = """<xyscripts>\patch (Classic).exe""";
run $wincmd;
This, again, is identical to the previous expression.
So:
- to specify a string in XY: use single or double quotes (saying to XY: this is a string)
- if a string for windows contains a filename etc, it must be surrounded by double quotes, *if* it maybe contains blanks. (For XY these quotes are part of a string!)
- if a string in XY contains double quotes, and is inside double quotes, the contained double quotes must be doubled.
As a result I think the use of strings containing variables, all specified inside double quotes, prevents unexperienced users from learning how you have to specify strings, and why it is this way.
(Though I wouldn't want to miss the ability to code it this way

)