[Solved]Button bar parameter %P could not hanlde comma(,).

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
sragin
Junior Member
Junior Member
Posts: 2
Joined: 2016-12-30, 06:44 UTC

[Solved]Button bar parameter %P could not hanlde comma(,).

Post by *sragin »

Button bar parameter %P could not hanlde comma(,) right way.
If folder name has comma, %P passes not full path but just before comma.

example) (This example is wrong)
original - d:\my folder\sw\mega,tera\
%P result - d:\my folder\sw\mega


[Solved] (This solution is wrong)
To solve above problem, use double quotaion marks surrounding parameters.
Dont : %P
Do : "%P"


[Added]
TC could handle commas(including white spaces) right way.
original - d:\my folder\sw\mega,tera\
%P result - d:\my folder\sw\mega,tera\
%1 result in CMD - d:\my
%2 result in CMD - folder\sw\mega
Last edited by sragin on 2017-06-29, 01:34 UTC, edited 1 time in total.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

sragin,
Not confirmed. The comma sign is included here.

Also:
example)
original - d:\my folder\sw\mega,tera\
%P result - d:\my folder\sw\mega
Nope, %P result would be:

Code: Select all

d:\my
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Post by *gdpr deleted 6 »

The comma splitting indeed happens, at least when involving batch files (i am not sure what would happen when a toolbar button is invoking an exe in this situation; i believe comma-splitting would not happen, but i am not certain... UPDATE: just confirmed that for exe files the behavior is also like CMD - i.e., only white-spaces being argument delimiters when invoking exe files).

Although, this behavior is not a bug.

CMD has exactly the same behavior when invoking batch files with such parameters. It might be debatable whether such a behavior is really useful, but it isn't really a bug...

By the way, commas and white-spaces (as Hacker rightfully pointed out) are not the only argument delimiters when invoking batch files. Semicolon and equal sign are argument delimiters, too. This is in contrast to invoking exe files from command line, where the only argument delimiter are white-spaces (afaik).
sragin
Junior Member
Junior Member
Posts: 2
Joined: 2016-12-30, 06:44 UTC

Post by *sragin »

Thank you Hacker, elgonzo. You are right.
I didn't know about the behavior of parameters when involving batch files. I thought that all %P output have to match exactly with %1(or %2) in batch file.
Now I understood that the comma splitting happens because of not TC but CMD(windows).
In my opinion, if someone want to prevent unwanted splitting in batch files use "%P""%N". The others ("%P"%N, %P%N, "%P%N") didn't work in my system if path and name have commas(including spaces).
Post Reply