Please add unquote parameters for %N %S and so on.

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
dindog
Senior Member
Senior Member
Posts: 315
Joined: 2010-10-18, 07:41 UTC

Please add unquote parameters for %N %S and so on.

Post by *dindog »

I am not really familiar with command line, so I met great difficulty in handling quoted and unquoted file name for its inconsistency, like this:

askparam.exe /u"path: %P%N" /t"path: %T%N" /p(e) cmd /k echo %001

askparam is a small tool written by MVV which allows user select predefined option in a GUI for command line tools. TC will automatic adding quote mark when the file name full path has space in it which will break existing /u and /t quote mark, even this tool provide a param like /q"`" to input double quote mark in other character, I can do nothing with TC added quote mark.

If an unquote %N is available, I can use below code to ensure it's properly quoted:
askparam.exe /q"`" /u"path:` %P%N`" /t"path: `%T%N`" /p(e) cmd /k echo %001
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: Please add unquote parameters for %N %S and so on.

Post by *MVV »

I agree that quoting logic of TC parameter placeholders is a bit weird, and it would be much better to have two sets of placeholders (or maybe a set and a Q modifier, like in MultiArc), one always unquoted and another always quoted, and so for every single placeholder (P, N, T, M, S, *L etc). And it would be a really nice addition in TC 9.5. :D

But as for AskParam, you can use workarounds:

Code: Select all

AskParam.exe /u"path: "%P%N /t"path: "%T%N /p(he) cmd /k echo "%%001" -- adjacent quoted strings are concatenated
AskParam.exe /u"path: %P%O.%E" /t"path: %T%O.%E" /p(he) cmd /k echo "%%001" -- %O.%E is never quoted
(fixed %T%O.%E)
Last edited by MVV on 2019-12-20, 12:10 UTC, edited 1 time in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Please add unquote parameters for %N %S and so on.

Post by *ghisler(Author) »

%T%N%O.%E should be %T%O.%E
Author of Total Commander
https://www.ghisler.com
User avatar
dindog
Senior Member
Senior Member
Posts: 315
Joined: 2010-10-18, 07:41 UTC

Re: Please add unquote parameters for %N %S and so on.

Post by *dindog »

MVV wrote: 2019-12-17, 05:34 UTC I agree that quoting logic of TC parameter placeholders is a bit weird, and it would be much better to have two sets of placeholders (or maybe a set and a Q modifier, like in MultiArc), one always unquoted and another always quoted, and so for every single placeholder (P, N, T, M, S, *L etc). And it would be a really nice addition in TC 9.5. :D

But as for AskParam, you can use workarounds:

Code: Select all

AskParam.exe /u"path: "%P%N /t"path: "%T%N /p(he) cmd /k echo "%%001" -- adjacent quoted strings are concatenated
AskParam.exe /u"path: %P%O.%E" /t"path: %T%N%O.%E" /p(he) cmd /k echo "%%001" -- %O.%E is never quoted
I think the first work-around would serveice most of my purpose. I'll use this tips if TC don't add unquoted placeholder in the end. Thanks.

The second will leave a "." if the item on the cursor is a folder.
Post Reply