If I use %COMMANDER_DRIVE% variable in "Command" input box in "Change Start Menu" dialog, it expands as expected. But if I try to use same variable in "Parameters" input box it doesn't expand.
Is there any way I reference file on portable device in "Parameters" input box?
I would also appreciate any reasonable advice, if TC doesn't provide way out.
TIA
%COMMANDER_DRIVE% variable in "Parameters" input b
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 48523
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
You cannot use environment variables in "parameters" because they collide with placeholders like %P%N. But you can put parameters in "command" input box if you use double quotes correctly, e.g.
"%COMMANDER_Path%\Program name" "%COMMANDER_DRIVE% and other stuff" other_parameter
"%COMMANDER_Path%\Program name" "%COMMANDER_DRIVE% and other stuff" other_parameter
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Thanks for your fast reply
I already tried that, and although it shows flexibility it isn't applicable for my example. I'm trying to run libxml's "xsltproc.exe" and apply transformation from xslt located on portable device, while xsltproc usage is this:
Or in my example:
So I can use "%COMMANDER_DRIVE%\XSLT\my_transform.xsl" in "Command" input box to reference my transformation, but I would have to set "--output" before it, while I want to use "%O" for output xml file (which can't be used in "Command" input box)
Sorry if my explanation seem complicated, I guess I need to wrap this process in batch script instead, but I thought to ask first in case I miss something.
I already tried that, and although it shows flexibility it isn't applicable for my example. I'm trying to run libxml's "xsltproc.exe" and apply transformation from xslt located on portable device, while xsltproc usage is this:
Code: Select all
xsltproc.exe [options] stylesheet file [file ...]
Code: Select all
xsltproc.exe --output some-file.xml --novalid %COMMANDER_DRIVE%\XSLT\my_transform.xsl some-file.xml
Sorry if my explanation seem complicated, I guess I need to wrap this process in batch script instead, but I thought to ask first in case I miss something.
- ghisler(Author)
- Site Admin
- Posts: 48523
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
In fact this isn't possible directly. You will have to write a small batch file or cmd script which changes the order of the parameters.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Something like this should work:
Code: Select all
Command=%ComSpec%
Parameters=/c "title xsltproc & "X:\Path\To\xsltproc.exe" --output "%P%O (out).%E" --novalid %%COMMANDER_DRIVE%%\XSLT\my_transform.xsl "%P%O.%E""
Minimized=Yes or No
Thanks for your replies
Yes, it was something very similar to lines posted by MVV which seem like something I should have posted to complete this thread...
I thought to reply in case it's "useful" that while setting up Saxon processor I needed to use jar protocol and I was missing URI reference to focused file. This also can be set by batch operators, by replacing backslashes to slashes, although for some reason I thought that TC offers placeholder for it, but I can't see it in help file.
Working example:
Yes, it was something very similar to lines posted by MVV which seem like something I should have posted to complete this thread...
I thought to reply in case it's "useful" that while setting up Saxon processor I needed to use jar protocol and I was missing URI reference to focused file. This also can be set by batch operators, by replacing backslashes to slashes, although for some reason I thought that TC offers placeholder for it, but I can't see it in help file.
Working example:
Code: Select all
@echo off
rem Command: cmd /k %COMMANDER_DRIVE%\XML\xslt\style-transform.cmd %COMMANDER_DRIVE%
rem Parameter: %P%N
set uri=%2
set uri=%2:\=/%
set xslt=%1\XML\xslt\style-transform.xslt
set xslt=%xslt:\=/%
%1\java\jre\bin\java.exe -cp %1\SaxonHE9\saxon9he.jar net.sf.saxon.Transform -xsl:%xslt% -u jar:file:///%uri%!/word/document.xml -o:%~n2.xml