Embedding command line parameters

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
HarryR
Posts: 7
Joined: 25 Jun 2009 19:20

Embedding command line parameters

Post by HarryR »

In an attempt to get rid of the ugly 7zip and find something else that can join .001 files, I am trying to use a little utility call FFSJ, which I found at http://www.jaist.ac.jp/~hoangle/filesj/

As part of trying to make a totally portable flashdrive, I am trying to get XYPlorer to use FFSJ in command-line mode when I double-click a file with the extension .001.

The FFSJ site gives the command-line example of :
FFSJ.exe "-Task=Join" "-Input=c:\test\SP\LargeFile.dat.001"

I've been trying to do this with XYPlorer's portable file associations or scripts, but I can't see a way to get XY to pass the name of the file I click on into the command. I've tried replacing c:\test\SP\LargeFile.dat.001 with %1, but XY isn't having it.

Can anyone suggest a way to do this ?

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Embedding command line parameters

Post by serendipity »

Select your .001 file and try this:

Code: Select all

run """Path to FFSJ.exe"" -Task=Join -Input=""<curitem>""";
Edit: Oh, you asked for POM, in which case it would be this:

Code: Select all

"Join files" 001>::run """Path to FFSJ.exe"" -Task=Join -Input=""<curitem>""";

HarryR
Posts: 7
Joined: 25 Jun 2009 19:20

Re: Embedding command line parameters

Post by HarryR »

Excellent, that's done it. Many thanks, serendipity.

HarryR
Posts: 7
Joined: 25 Jun 2009 19:20

Re: Embedding command line parameters

Post by HarryR »

Whoops, one further question: it's working with the Portable File Association :

+001>::run "L:\Apps\Portable\FastFileSplitterJoiner\FFSJ.exe" "-Task=Join" "-Input=<curitem>"

but when I try to replace the L: with ?:, it can't handle it.

Is there any way to make this sort of script drive letter-neutral ?

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Embedding command line parameters

Post by serendipity »

HarryR wrote:Whoops, one further question: it's working with the Portable File Association :

+001>::run "L:\Apps\Portable\FastFileSplitterJoiner\FFSJ.exe" "-Task=Join" "-Input=<curitem>"

but when I try to replace the L: with ?:, it can't handle it.

Is there any way to make this sort of script drive letter-neutral ?
Ok seems like run does not support ?:, maybe try openwith instead, like this:

Code: Select all

::openwith "?:\Apps\Portable\FastFileSplitterJoiner\FFSJ.exe" "-Task=Join" "-Input=<curitem>"

admin
Site Admin
Posts: 66347
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Embedding command line parameters

Post by admin »

serendipity wrote:
HarryR wrote:Whoops, one further question: it's working with the Portable File Association :

+001>::run "L:\Apps\Portable\FastFileSplitterJoiner\FFSJ.exe" "-Task=Join" "-Input=<curitem>"

but when I try to replace the L: with ?:, it can't handle it.

Is there any way to make this sort of script drive letter-neutral ?
Ok seems like run does not support ?:, maybe try openwith instead, like this:

Code: Select all

::openwith "?:\Apps\Portable\FastFileSplitterJoiner\FFSJ.exe" "-Task=Join" "-Input=<curitem>"
It might be useful to add a function to scripting that resolves a portable or relative path. Not sure how to call it. Any ideas?

HarryR
Posts: 7
Joined: 25 Jun 2009 19:20

Re: Embedding command line parameters

Post by HarryR »

Perfect - thanks again, serendipity.

HarryR
Posts: 7
Joined: 25 Jun 2009 19:20

Re: Embedding command line parameters

Post by HarryR »

admin wrote: It might be useful to add a function to scripting that resolves a portable or relative path. Not sure how to call it. Any ideas?
I'm not quite clear what you mean. Would such a function do more than the "?:" we refer to above ?

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Embedding command line parameters

Post by serendipity »

HarryR wrote:
admin wrote: It might be useful to add a function to scripting that resolves a portable or relative path. Not sure how to call it. Any ideas?
I'm not quite clear what you mean. Would such a function do more than the "?:" we refer to above ?
He means a new command to resolve any ?: to actual path like c:.
@Don: may be Showpath? ResolvePath?

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Embedding command line parameters

Post by TheQwerty »

admin wrote:It might be useful to add a function to scripting that resolves a portable or relative path. Not sure how to call it. Any ideas?
If you want one for each direction: abs2rel and rel2abs.
If you want one with a switch: ResolvePath.

Could also be useful if there were a command or xy-var to retrieve the drive letter based on the volume label or serial number.

admin
Site Admin
Posts: 66347
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Embedding command line parameters

Post by admin »

HarryR wrote:
admin wrote: It might be useful to add a function to scripting that resolves a portable or relative path. Not sure how to call it. Any ideas?
I'm not quite clear what you mean. Would such a function do more than the "?:" we refer to above ?
You could do something like this (air code obviously, not sure about that FFSJ syntax):

Code: Select all

+001>::run resolvepath("?:\Apps\Portable\FastFileSplitterJoiner\FFSJ.exe") . " " . quote("-Task=Join") . " " . quote("-Input=<curitem>")

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Embedding command line parameters

Post by Stefan »

admin wrote:It might be useful to add a function to scripting that resolves a portable or relative path.
Not sure how to call it. Any ideas?
And i think <xydrive> is missing from XYplorer Native Variables.

<xydrive> current drive letter XY runs from right now.

admin
Site Admin
Posts: 66347
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Embedding command line parameters

Post by admin »

Stefan wrote:
admin wrote:It might be useful to add a function to scripting that resolves a portable or relative path.
Not sure how to call it. Any ideas?
And i think <xydrive> is missing from XYplorer Native Variables.

<xydrive> current drive letter XY runs from right now.
Yes, that would help in the OP's case. Will add it.

RalphM
Posts: 2089
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Embedding command line parameters

Post by RalphM »

And could <xydrive> then be usable in the TitleBarTemplate as well, please?
Ralph :)
(OS: W11 25H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)

admin
Site Admin
Posts: 66347
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Embedding command line parameters

Post by admin »

RalphM wrote:And could <xydrive> then be usable in the TitleBarTemplate as well, please?
Why? :)

Actually I could make the make the titlebar fully XY-var aware. Would that be interesting?

Post Reply