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
[Solved]Button bar parameter %P could not hanlde comma(,).
Moderators: Hacker, petermad, Stefan2, white
[Solved]Button bar parameter %P could not hanlde comma(,).
Last edited by sragin on 2017-06-29, 01:34 UTC, edited 1 time in total.
sragin,
Not confirmed. The comma sign is included here.
Also:
Roman
Not confirmed. The comma sign is included here.
Also:
Nope, %P result would be:example)
original - d:\my folder\sw\mega,tera\
%P result - d:\my folder\sw\mega
Code: Select all
d:\my
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.
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
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).
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).
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).
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).