Can smbd please make a "300% guaranteed to work" instruction on how to use these?
Every single time i deal with this command(variation), i stumble upon problem to make it work. Obviously it's 'cause i'm noob and don't get something, plus complexity of quote-rules, but somehow that's The Only command i ever have problem with, ending up spending hours, trying all variants i can imagine, till "maybe" one will work.
The legend:
<tool>
<target>
<result>
==all these paths can have spaces!
<-param1> <-param2> (several of those separated by spaces)
<work_dir> (?idiotic parameter seem to be demanded only for executables, or not)
So how would it look like, with all the properly added quotes, to work with mentioned: Run, RunQ, Run Quote() ?
Sorry if you find this question dumb/stupid(just pass by). After recently spending again couple hours and not finding a working way, i've got quite angry. Yet i understood that it's easier to make an LNK file and open that, than use Run command.(which definitely doesn't look normal)
So i wanna finally understand the proper always working way to use Run variations for complex run requests with additional paths and parameters.
P.S. Please don't send me to lax(). I've found it via search along with lots of topics that didn't answer my goal-question. Have no clue what lax is, and even though it seems to do the work much easier -- i really want to settle the deal of problem with these 3 Run variations, not just find a code variant that works and settle down.(as most users did in search results)
How to properly use Run, Runq, Run Quote() ?
How to properly use Run, Runq, Run Quote() ?
Last edited by eil on 29 Jan 2025 23:52, edited 1 time in total.
Win 7 SP1 x64 100% 1366x768|1900x1080
Re: How to propely use Run, Runq, Run Quote() ?
The two outer double quotes are stripped and all inner ones per each part as well
First step:
Last step:
and yes, using lax is much easier^^
Done...
And in general: Use
run """<tool>"" ""arg1"" ""arg2"" ... ""last arg""";First step:
run ""<tool>"" ""arg1"" ""arg2"" ... ""last arg"";Last step:
run "<tool>" "arg1" "arg2" ... "last arg";and yes, using lax is much easier^^
run lax("<tool>" "arg1" "arg2" ... "last arg");Done...
And in general: Use
step; before such a command to see how it will resolve...One of my scripts helped you out? Please donate via Paypal
Re: How to propely use Run, Runq, Run Quote() ?
Useful hint, thanks, usually have Step mode enabled but didn't ever insert per-command variant.
I simply don't know what lax stands for and how it works, that's why didn't even notice it being added.
That's actually an example why i made this question, cause this description is misleading: as i understood for now, only paths with spaces mandatory need own quotes, at the same time args don't need quotes(unless arg is a path, and even then only the path needs be quoted - not whole/each arg).
Plus, the thing with apostrophe sign( ' ) brings some turmoil when reading shared scripts, cause it's not really obvious that:
Code: Select all
"""<tool>"" ""<target>"" ""<result>"" arg1 arg2"
"'<tool>' '<target>' '<result>' arg1 arg2"Runq and Run Quote() remain a mystery for me, as description made me think theses solely "add an extra quote wrap". So these variants should work the same, but again - nope:
Code: Select all
run """<tool>"" ""<target>"" ""<result>"" arg1 arg2";
runq ""<tool>"" ""<target>"" ""<result>"" arg1 arg2;
run quote(""<tool>"" ""<target>"" ""<result>"" arg1 arg2);Win 7 SP1 x64 100% 1366x768|1900x1080
Re: How to properly use Run, Runq, Run Quote() ?
It's not misleading, I'm just assuming that your args are strings that can have space(s), e.g. when usingcause this description is misleading
ffmpeg for doing stuffIf they actually contain spaces or not is irrelevant because you should always assume that they could have them
Especially when using variables
Ofc you do not need the quotes when no quoting is necessary^^
Code: Select all
run """C:\one space\app.exe"" ""D:\two spaces\a.pdf"" --no-defaults --output=""E:\b.pdf""";
runq nor single quotes for run (because variables aren't resolved inside single quotes)One of the reasons why
lax() is the command of choice is: an embedded call
Code: Select all
run lax("$hstart" /UAC ""$fileLocker" /k "<curitem>""), "%TEMP%", 0, 1;
lax()^^This call is clean, logical and you don't need to wrap your mind around that...
There is one exception when you can't use
lax(): You have non-quotable arguments that contain a ;...One of my scripts helped you out? Please donate via Paypal
Re: How to properly use Run, Runq, Run Quote() ?
Didn't know that variable vs single quote thing. Damn hope won't forget it.
Still, can you please elaborate how lax works/what it does? Why it seem to solve those quoting problems easily while prior commands can't do same?
Win 7 SP1 x64 100% 1366x768|1900x1080
XYplorer Beta Club