Page 1 of 1
How to open folder in new tab from the command line?
Posted: 19 Mar 2022 20:25
by zBernie
I was researching how to run xyplorer.exe from the command line, pass it a path, and have that open in a new tab. I found the answer below but you can see the error I'm getting. I'm using XYplorer 22.90.0100.
Is there a way to open a folder in a new tab from the command line?
PS C:\Users\bernie> "C:\Program Files (x86)\XYplorer\XYplorer.exe" /script="::focus 'P2'; tab('new', '{C:\Users\bernie}'); #302;"
ParserError:
Line |
1 | "C:\Program Files (x86)\XYplorer\XYplorer.exe" /script="::focus 'P2'; …
| ~
| You must provide a value expression following the '/' operator.
Re: How to open folder in new tab from the command line?
Posted: 19 Mar 2022 21:13
by Norn
viewtopic.php?p=195568#p195568
"D:\XYplorer\XYplorer.exe" /script="::focus 'p2'; tab('new', 'G:\Backups');"
Using CMD works fine...
Another way:
viewtopic.php?p=194226#p194226
Re: How to open folder in new tab from the command line?
Posted: 19 Mar 2022 23:26
by zBernie
Oddly, regardless of what path I give it, it always opens to "This PC", and no new tab is created. Any ideas?
"C:\Program Files (x86)\XYplorer\XYplorer.exe" /script="::focus 'p2'; tab('new', 'C:\Windows');
Re: How to open folder in new tab from the command line?
Posted: 20 Mar 2022 01:47
by RalphM
Check your quoting, you're missing a closing ".
Re: How to open folder in new tab from the command line?
Posted: 20 Mar 2022 03:19
by zBernie
RalphM wrote: ↑20 Mar 2022 01:47
Check your quoting, you're missing a closing ".
Duh, thanks that was it. See how dangerous copy and paste can be!

Re: How to open folder in new tab from the command line?
Posted: 20 Mar 2022 05:35
by jupe
You must consider reading and referencing the help file to be downright life and death for you then.
Re: How to open folder in new tab from the command line?
Posted: 20 Mar 2022 18:28
by zBernie
jupe wrote: ↑20 Mar 2022 05:35
You must consider reading and referencing the help file to be downright life and death for you then.
You are hilarious. And completely wrong. I read the section in the manual "Command Line Switches", there is nothing about opening a folder in a new tab. Lots of stuff on command line switches, not what I was after though. Try reading it and you will see what I mean.
Re: How to open folder in new tab from the command line?
Posted: 20 Mar 2022 18:45
by highend
And looking up tab() didn't come to your mind?
Re: How to open folder in new tab from the command line?
Posted: 20 Mar 2022 20:16
by zBernie
highend wrote: ↑20 Mar 2022 18:45
And looking up
tab() didn't come to your mind?
Searching for "tab()" returns nothing. Searching for "tab" returns dozens of matches, none of which have anything to do with opening a new tab from the command line. Try it yourself. Subsequently, since you cannot search on a page for text, I copied and pasted the entire contents of the section "Command Line Switches". The word tab is there, but not how to open a new tab from the command line.
Make sense now?
Re: How to open folder in new tab from the command line?
Posted: 20 Mar 2022 20:28
by highend
It doesn't make sense at all.
Maybe instead of posting all that stuff, you SHOULD READ IT^^ Btw, I've removed it from your post, if anyone's interested, the help file provides that^^
1) The path to a script file (commonly called *.xys). The file spec is resolved as in the script command load, so you can skip the XYS extension. You can also skip the path if the XYS file is located in the default scripts folder. For example
XYplorer.exe /script=test
would run the file <xyscripts>\test.xys on startup. If the path contains spaces it must be quoted:
XYplorer.exe /script="C:\Zen\test one.xys"
2) A script. It must be preceded by ::
So does the list of arguments contain a
/script= part?
What the hell do you think where
tab() can be find in this case?
Re: How to open folder in new tab from the command line?
Posted: 20 Mar 2022 22:41
by zBernie
highend wrote: ↑20 Mar 2022 20:28
It doesn't make sense at all.
Maybe instead of posting all that stuff, you SHOULD READ IT^^ Btw, I've removed it from your post, if anyone's interested, the help file provides that^^
1) The path to a script file (commonly called *.xys). The file spec is resolved as in the script command load, so you can skip the XYS extension. You can also skip the path if the XYS file is located in the default scripts folder. For example
XYplorer.exe /script=test
would run the file <xyscripts>\test.xys on startup. If the path contains spaces it must be quoted:
XYplorer.exe /script="C:\Zen\test one.xys"
2) A script. It must be preceded by ::
So does the list of arguments contain a
/script= part?
What the hell do you think where
tab() can be find in this case?
So the "Command Line Switches" section does not explicitly say how to open a folder in a new tab, but rather that you can pass a function on the command line. And that I should have known there was a function named tab().