TCBL new version (1.04 )

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Some user has suggested to put
CHCP 1252
in a batch file in front of the command, see:
http://ghisler.ch/board/viewtopic.php?t=18748
Author of Total Commander
https://www.ghisler.com
tcvol
Junior Member
Junior Member
Posts: 67
Joined: 2009-02-02, 12:35 UTC

Post by *tcvol »

ghisler(Author) wrote:Some user has suggested to put
CHCP 1252
in a batch file in front of the command, see:
ok if i just start the normal cmd and type
chcp it says that 850 is active

if i use it in the test.ini file
cmd=chcp it says 1252 is active

i tried to set the codepage with both values, there is no difference.


i have 2 other small requests:

1)
is it possible to make use of %commander_path% in the alternate ini call?

currently i have to use the following for relative paths:
command: %commander_path%\addons\tcmd\TCBL\tcbl.exe
parameters: -I test.ini %L test
command path: %commander_path%\addons\tcmd\TCBL

i tried for parameters:
-I %commander_path%\addons\tcmd\tcbl\test.ini %L test
-I %%commander_path%%\addons\tcmd\tcbl\test.ini %L test
-I "%commander_path%\addons\tcmd\tcbl\test.ini" %L test
-I "%%commander_path%%\addons\tcmd\tcbl\test.ini" %L test
which didn't work.

2)
it seems that spaces are not "entirely" supported:
i mean it somehow works, but it is ugly ;-) .. what do you think?

ini:
[testspaces]
pre=@echo on
cmd=mkdir "$1\$n
cmd=echo $n
end=pause

input:
c:\temp\test\Mühlen S01.TEST\

output dir ("%T"):
C:\temp\test\out put

command:
%commander_path%\addons\tcmd\TCBL\tcbl.exe
parameters:
-I test.ini %L testspaces "%T"
start path:
%commander_path%\addons\tcmd\TCBL

console output:
C:\xp\util\tcmd7\addons\tcmd\TCBL>mkdir "C:\temp\test\out "put"\Mühlen S01.TEST"


C:\xp\util\tcmd7\addons\tcmd\TCBL>echo "Mühlen S01.TEST"
"Mühlen S01.TEST"

C:\xp\util\tcmd7\addons\tcmd\TCBL>pause
Drücken Sie eine beliebige Taste . . .
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

1)
is it possible to make use of %commander_path% in the alternate ini call?
Try:
command: %commander_path%\addons\tcmd\TCBL\tcbl.exe -I %commander_path%\addons\tcmd\tcbl\test.ini
parameters: %L test
command path: %commander_path%\addons\tcmd\TCBL

Note: environment variables are resolved as command only, while %L is resolved as parameter only ...
#5767 Personal license
tcvol
Junior Member
Junior Member
Posts: 67
Joined: 2009-02-02, 12:35 UTC

Post by *tcvol »

sqa_wizard wrote:
1)
is it possible to make use of %commander_path% in the alternate ini call?
Try:
command: %commander_path%\addons\tcmd\TCBL\tcbl.exe -I %commander_path%\addons\tcmd\tcbl\test.ini
parameters: %L test
command path: %commander_path%\addons\tcmd\TCBL

Note: environment variables are resolved as command only, while %L is resolved as parameter only ...
thx sqa_wizard
it works now the way you described.


and this works as well:

command: %commander_path%\tcbl\tcbl.exe -I %commander_path%\tcbl\test.ini
parameters: %L testumlaute %%commander_path%%\addons\util\winrar\winrar.exe
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

tcvol wrote:if i use it in the test.ini file
cmd=chcp it says 1252 is active

i tried to set the codepage with both values, there is no difference.
I tried also a bunch of stuff but I did not yet find a way to to solve this yet...
tcvol wrote:i have 2 other small requests:
1)
is it possible to make use of %commander_path% in the alternate ini call?
.....
You can use %commander_path% :
- in the command section of Total commander.
- as a parameter or for a command
- inside the ini file.
but not to define an alternate ini file.
tcvol wrote:2)
it seems that spaces are not "entirely" supported:
i mean it somehow works, but it is ugly ;-) .. what do you think?
It is fixed, you can try the new tcbl_update.zip file !

Code: Select all

end=pause
If you add p as command line option, you do not have to use any pause.
tcvol
Junior Member
Junior Member
Posts: 67
Joined: 2009-02-02, 12:35 UTC

Post by *tcvol »

nsp wrote:
tcvol wrote:It is fixed, you can try the new tcbl_update.zip file !
parameters:
%L testspaces "%T"

ini:
[testspaces]
pre=@echo on
cmd=mkdir "$1\$n"
cmd=echo . > "$1\$n\$n.nfo"
end=pause

console output:

Code: Select all

C:\temp\test>mkdir "C:\temp\test\out put"\SchneeweißTEST"

C:\temp\test>echo .  1>"C:\temp\test\out put"\SchneeweißTEST\SchneeweißTEST.nfo"


C:\temp\test>mkdir "C:\temp\test\out put"\Neue Mühlen S01TEST.TEST"

C:\temp\test>echo .  Mühlen S01TEST.TEST\Neue Mühlen S01TEST.TEST.nfo" 1>"C:\tem
p\test\out put"\Neue
Zugriff verweigert

C:\temp\test>mkdir "C:\temp\test\out put"\ÄrmelkanalTEST.TEST"

C:\temp\test>echo .  1>"C:\temp\test\out put"\ÄrmelkanalTEST.TEST\ÄrmelkanalTEST
.TEST.nfo"

C:\temp\test>pause
Drücken Sie eine beliebige Taste . . .
parameters:
%L testspaces "%T"

ini:
[testspaces]
pre=@echo on
cmd=mkdir $1\$n
cmd=echo . > $1\$n\$n.nfo
end=pause

Code: Select all

C:\temp\test>mkdir "C:\temp\test\out put"\SchneeweißTEST"

C:\temp\test>echo .  1>"C:\temp\test\out put"\SchneeweißTEST\SchneeweißTEST.nfo"


C:\temp\test>mkdir "C:\temp\test\out put"\Neue Mühlen S01TEST.TEST"

C:\temp\test>echo .  Mühlen S01TEST.TEST\Neue Mühlen S01TEST.TEST.nfo" 1>"C:\tem
p\test\out put"\Neue
Zugriff verweigert

C:\temp\test>mkdir "C:\temp\test\out put"\ÄrmelkanalTEST.TEST"

C:\temp\test>echo .  1>"C:\temp\test\out put"\ÄrmelkanalTEST.TEST\ÄrmelkanalTEST
.TEST.nfo"

C:\temp\test>pause
Drücken Sie eine beliebige Taste . . .

--> does work for $1 (output) with spaces .. does not work if $n has spaces

those dirs are created:
c:\temp\test\Mühlen\
c:\temp\test\S01TEST.TEST\
c:\temp\test\out put\ÄrmelkanalTEST.TEST\
c:\temp\test\out put\Neue\
c:\temp\test\out put\SchneeweißTEST\
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

tcvol wrote:

Code: Select all

parameters:
%L testspaces "%T"
if you define "%T" in TC, TCBL intercept %T" and not %T i did a try wit a very simple C porgramm that show params.
From command line I did not get the extra quote.....


if your last param is "%T" , you can simply use "%T instead.. I will post a fix that strip last " from parameters.

==Edited==

Fix is online.
tcvol
Junior Member
Junior Member
Posts: 67
Joined: 2009-02-02, 12:35 UTC

Post by *tcvol »

nsp wrote:
tcvol wrote:

Code: Select all

parameters:
%L testspaces "%T"
if you define "%T" in TC, TCBL intercept %T" and not %T i did a try wit a very simple C porgramm that show params.
From command line I did not get the extra quote.....


if your last param is "%T" , you can simply use "%T instead.. I will post a fix that strip last " from parameters.

==Edited==

Fix is online.
thx very much ..
it works now with "%T":

C:\temp\te st>mkdir "C:\temp\te st\out put\ÄrmelkanalTEST.TEST"

C:\temp\te st>echo . 1>"C:\temp\te st\out put\ÄrmelkanalTEST.TEST\ÄrmelkanalTES
T.TEST.nfo"

C:\temp\te st>mkdir "C:\temp\te st\out put\Neue Mühlen S01TEST.TEST"

C:\temp\te st>echo . 1>"C:\temp\te st\out put\Neue Mühlen S01TEST.TEST\Neue Müh
len S01TEST.TEST.nfo"

C:\temp\te st>mkdir "C:\temp\te st\out put\S01TEST.TEST"

C:\temp\te st>echo . 1>"C:\temp\te st\out put\S01TEST.TEST\S01TEST.TEST.nfo"

C:\temp\te st>mkdir "C:\temp\te st\out put\SchneeweißTEST"

C:\temp\te st>echo . 1>"C:\temp\te st\out put\SchneeweißTEST\SchneeweißTEST.nfo
"

C:\temp\te st>pause
Drücken Sie eine beliebige Taste . . .

dirs:
c:\temp\te st\out put\ÄrmelkanalTEST.TEST\ÄrmelkanalTEST.TEST.nfo
c:\temp\te st\out put\Neue Mühlen S01TEST.TEST\Neue Mühlen S01TEST.TEST.nfo
c:\temp\te st\out put\S01TEST.TEST\S01TEST.TEST.nfo
c:\temp\te st\out put\SchneeweißTEST\SchneeweißTEST.nfo
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

Same version re-posted with code cleanup and smaller exe size.
here !..

==> Suggestion for next versions (around mid-April) ??

Those are the one i have but i will not implement all at once.
- Directory listing (instead of flat file) ?
- Alternative script processor ?
- ini script editor and graphical debugger ?
- embedded console ?
- unicode support ?

- stop dev it is useless !
tcvol
Junior Member
Junior Member
Posts: 67
Joined: 2009-02-02, 12:35 UTC

Post by *tcvol »

small bug:
when i use the command
pushd "$p" works only with cmd= but not with pre= or end=
Last edited by tcvol on 2009-02-23, 11:49 UTC, edited 1 time in total.
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

tcvol wrote:small bug:
when i use the command
pushd "$p" works only with cmd= but not with pre= or end=
This is not a bug !
As pre and end are valid for all files, none of the file specific $directives are interpreted.

If you use TCBL from the search result list or with Branch view (^B in TC), selected files can have different path.
tcvol
Junior Member
Junior Member
Posts: 67
Joined: 2009-02-02, 12:35 UTC

Post by *tcvol »

i think there is still a bug with quotes:

please try this script:
[testhd]
pre=echo var1: $1
pre=echo var1 quotes from tcbl script: "$1"
pre=echo var1: $2
pre=echo var1 quotes from tcbl script: "$2"
pre=echo var1: $3
pre=echo var1 quotes from tcbl script: "$3"
pre=PAUSE

with this menu button:
command: %commander_path%\addons\tcmd\tcbl\tcbl.exe -I "%commander_path%\addons\tcmd\tcbl\testhd.ini"
parameters: ?%P%N testhd %P "%P" ""%P""

check var2.
the output is not as it should be:

1) output from input c:\temp\!test:

Code: Select all

C:\temp>echo var1: C:\temp\
var1: C:\temp\

C:\temp>echo var1 quotes from tcbl script: "C:\temp\"
var1 quotes from tcbl script: "C:\temp\"

C:\temp>echo var2: C:\temp" "C:\temp"
var2: C:\temp" "C:\temp"

C:\temp>echo var2 quotes from tcbl script: "C:\temp" "C:\temp""
var2 quotes from tcbl script: "C:\temp" "C:\temp""

C:\temp>echo var3:
var3:

C:\temp>echo var3 quotes from tcbl script:
var3 quotes from tcbl script:

C:\temp>PAUSE
Drücken Sie eine beliebige Taste . . .
2)
input from c:\TEMP\te st\!sync.log

Code: Select all


C:\TEMP\te st>echo var1: C:\TEMP\te
var1: C:\TEMP\te

C:\TEMP\te st>echo var1 quotes from tcbl script: "C:\TEMP\te"
var1 quotes from tcbl script: "C:\TEMP\te"

C:\TEMP\te st>echo var2: st\
var2: st\

C:\TEMP\te st>echo var2 quotes from tcbl script: "st\"
var2 quotes from tcbl script: "st\"

C:\TEMP\te st>echo var3: C:\TEMP\te st" "C:\TEMP\te
var3: C:\TEMP\te st" "C:\TEMP\te

C:\TEMP\te st>echo var3 quotes from tcbl script: "C:\TEMP\te st" "C:\TEMP\te"
var3 quotes from tcbl script: "C:\TEMP\te st" "C:\TEMP\te"

C:\TEMP\te st>PAUSE
Drücken Sie eine beliebige Taste . . .
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

tcvol wrote:i think there is still a bug with quotes:

Code: Select all

[testhd]
pre=echo var1: $1
.....

Code: Select all

parameters: ?%P%N testhd [b]%P[/b] "%P" ""%P""
Hi,
i think there is a misunderstanding about quote, i only try to automatically quote $directives and this only inside tcbl and mainly for file directives.

Here, it seem that %P contains space and as it is passed by TC, you should quote all the single % parameter coming from TC.

About Bug :
:oops: There is a bug with checking $2 $... i will post a fix soon

[EDITED !!]
in fact, it seems that the parameters ar not well transmitted to the program.
// I've made a very simple C proggy that just output argc, argv
and this echoo.exe return same as tcbl.

I've found a way to have correct result with TC :

Code: Select all

parameters: ?%P%N testhd "%P"" "%P"" "%P""
tcvol
Junior Member
Junior Member
Posts: 67
Joined: 2009-02-02, 12:35 UTC

Post by *tcvol »

nsp wrote:
I've found a way to have correct result with TC :

Code: Select all

parameters: ?%P%N testhd "%P"" "%P"" "%P""
that is not always correct.
it works only if your path actually has spaces.
check # 1

parameters:?%P%N testhd %P "%P" "%P""

1)
e.g.:
%P = c:\Downloads\!list.nfo

Code: Select all

C:\Downloads>echo var1: C:\Downloads\
var1: C:\Downloads\

C:\Downloads>echo var1 quotes from tcbl script: "C:\Downloads"
var1 quotes from tcbl script: "C:\Downloads"

C:\Downloads>echo var2: C:\Downloads" C:\Downloads"
var2: C:\Downloads" C:\Downloads"

C:\Downloads>echo var2 quotes from tcbl script: "C:\Downloads" C:\Downloads""
var2 quotes from tcbl script: "C:\Downloads" C:\Downloads""

C:\Downloads>echo var3:
var3:

C:\Downloads>echo var3 quotes from tcbl script:
var3 quotes from tcbl script:

C:\Downloads>PAUSE
Drücken Sie eine beliebige Taste . . .

2)
e.g.:
c:\temp\te st\!sync.log

Code: Select all

C:\temp\te st>echo var1: C:\temp\te
var1: C:\temp\te

C:\temp\te st>echo var1 quotes from tcbl script: "C:\temp\te"
var1 quotes from tcbl script: "C:\temp\te"

C:\temp\te st>echo var2: st\
var2: st\

C:\temp\te st>echo var2 quotes from tcbl script: "st"
var2 quotes from tcbl script: "st"

C:\temp\te st>echo var3: C:\temp\te st" C:\temp\te
var3: C:\temp\te st" C:\temp\te

C:\temp\te st>echo var3 quotes from tcbl script: "C:\temp\te st" C:\temp\te"
var3 quotes from tcbl script: "C:\temp\te st" C:\temp\te"

C:\temp\te st>PAUSE
Drücken Sie eine beliebige Taste . . .
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

tcvol wrote:
that is not always correct.
it works only if your path actually has spaces.
check # 1
I have the same trouble with other console applications... I will dig for next major version
[Edited].........................................
[face=comicsansms]Yippee ![/face]

I found that the trouble are due to the trailing "" that make windows parsing wrongly interpret last " !
[face=courier]The Solution seems to be:[/face]

Code: Select all

parameters= %P%N testhd "%P" "%T" ....
Post Reply