Batch files as as toolbar button commands do NOT seem to be affected by the problem i describe here.
I could verify the problem with both x86 and x64 versions of TC8.51a.
The problem can be observed when using either %P or %T as part of toolbar button parameters. In my following explanation i use %T, but i tested %P as well - with the same results.
Problem scenario
I want to use a toolbar button command with the two parameters
Code: Select all
%T %N
Now, this works fine as long as the target path does not contain white-spaces.
But if the target path contains white-spaces, TC does not automatically use quotes for %T and i would need to add those quotes like this:
Code: Select all
"%T" %N
However, when using an .EXE executable as the toolbar button's command, this will not result in two parameters passed to the executable.
Instead, only an incorrect single argument is passed, which looks like:
Code: Select all
x:\123 456" somefile.txt
Note the single quote mark in the argument string.
As it seems, TC stumbles during assembling/passing the argument string when starting the .EXE in a new process.
I am not sure if this issue has been reported already. There are quite a few forum posts about handling of quote marks with regard to toolbar button parameters, but none of them seem to address this particular issue which only occurs when .EXE files are being used as toolbar button commands.
FYI
I used a very, very primitive C#/.NET console app to verify this unexpected behavior. Its code is merely:
Code: Select all
static void Main(string[] args)
{
Console.Out.WriteLine("args.Length = " + args.Length);
Console.Out.WriteLine();
foreach (string s in args)
Console.Out.WriteLine(s);
Console.In.Read();
}