C# How to make Total Commander execute a command?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Ivclim
Junior Member
Junior Member
Posts: 8
Joined: 2017-11-18, 19:47 UTC

Post by *Ivclim »

HolgerK wrote:2Ivclim
You did not read the help (F1) didn't you?

Your command line should look like one of these:

Code: Select all

Process.Start (file, @"\\Server\Total\tab_1_add.tab");

Code: Select all

Process.Start (file, @"\L=\\Server\Total\tab_1_add.tab");

Code: Select all

Process.Start (file, @"\R=\\Server\Total\tab_1_add.tab");
In addition you may have to quote the path if the path contains spaces:

Code: Select all

Process.Start (file, @"\R=""\\Server\Total Space\tab 1 add.tab""");
Regards
Holger

Edit "OPENTABS:" sample removed (i thought it should work the same like "FTPOPEN:" but this seems to be not implemented...)

Many thanks for the detailed description.

There is still a problem.
He works

Code: Select all

Process.Start (file, @"\\Server\Total\tab_1_add.tab");
Does not work

Code: Select all

Process.Start (file, @"\L=\\Server\Total\tab_1_add.tab");
and

Code: Select all

Process.Start (file, @"\R=\\Server\Total\tab_1_add.tab");
Video - https://youtu.be/1wAOjpjBOKk

Could you advise something.
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Post by *gdpr deleted 6 »

Ivclim wrote:Does not work

Code: Select all

Process.Start (file, @"\L=\\Server\Total\tab_1_add.tab");
and

Code: Select all

Process.Start (file, @"\R=\\Server\Total\tab_1_add.tab");
Look at the very first character of your argument strings. What do you see?
Ivclim
Junior Member
Junior Member
Posts: 8
Joined: 2017-11-18, 19:47 UTC

Post by *Ivclim »

2elgonzo
I do not understand.
Could you specify what is wrong.


PS
I'm just beginning to understand Total.
Therefore, I do not understand the specifics.
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Post by *gdpr deleted 6 »

Ivclim wrote:2elgonzo
I do not understand.
Could you specify what is wrong.
Look at your two argument strings:

Code: Select all

@"\L=\\Server\Total\tab_1_add.tab"
@"\R=\\Server\Total\tab_1_add.tab"
What is the first character in those strings?
Ivclim
Junior Member
Junior Member
Posts: 8
Joined: 2017-11-18, 19:47 UTC

Post by *Ivclim »

2elgonzo

I understood.

"\ R" and "\ L" to replace with "/ R" and "/ L"

It seems to be working.

So tnank you.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

2Horst.Epp
<OT>
Horst.Epp wrote:That would lead to the same recursion problem if the tab file also contains the active side dir. Only removing the active dir from the tab file avoids TC loop.
Who said that the TAB-file should hold the active side tabs too:
Wincmd.ini(partial..) wrote:[ViewModes]
0_name=TC_Plugins
0_icon=
0_commands=cm_FocusTrg,em_LoadPluginTabs,cm_FocusTrg
0_options=-1|-1|0||16711680|-1|-1
[ViewModeSwitch]
Enabled=1
0_rules=+%COMMANDER_PATH%\*.*
0_mode=0
Usercmd.ini(partial..) wrote:[em_LoadPluginTabs]
button=wcmicons.dll
cmd=OPENTABS %COMMANDER_PATH%\test\Plugins.tab
%COMMANDER_PATH%\test\Plugins.tab wrote:[activetabs]
0_path=%COMMANDER_PATH%\plugins\wcx\
0_options=1|0|0|0|0|0|0|
1_path=%COMMANDER_PATH%\plugins\wdx\
1_options=1|0|0|0|0|0|0|
2_path=%COMMANDER_PATH%\plugins\wfx\
2_options=1|0|0|0|0|0|0|
3_path=%COMMANDER_PATH%\plugins\wlx\
3_options=1|0|0|0|0|0|0|
activetab=0
Regards
Holger
</OT>
Make our planet great again
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2Horst.Epp
I tested with an absolute fresh ini file and TC doesn't crash but show the content of the tab file like an archive.
Hmm, if I make a cmd-file with this command:
C:\totalcmd\TOTALCMD64.EXE /i=F:\newtc.ini /R=C:\totalcmd\totalcmd.tab
it works perfectly OK.

So does this:
start "TC with tabs" C:\totalcmd\TOTALCMD64.EXE /i=f:\newtc.ini /R=C:\totalcmd\totalcmd.tab

It doesn't matter if the tab file contains tabs for both sides, or just for one side.

I have tested with both Windows 7 and 10

Do you perhaps have some AutoHokey or alike running, that makes TC open the .tab file like an archive?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

petermad wrote:2Horst.Epp
I tested with an absolute fresh ini file and TC doesn't crash but show the content of the tab file like an archive.
Hmm, if I make a cmd-file with this command:
C:\totalcmd\TOTALCMD64.EXE /i=F:\newtc.ini /R=C:\totalcmd\totalcmd.tab
it works perfectly OK.

So does this:
start "TC with tabs" C:\totalcmd\TOTALCMD64.EXE /i=f:\newtc.ini /R=C:\totalcmd\totalcmd.tab

It doesn't matter if the tab file contains tabs for both sides, or just for one side.

I have tested with both Windows 7 and 10

Do you perhaps have some AutoHokey or alike running, that makes TC open the .tab file like an archive?
No, there is nothing running in background.
It show my tab file as:
c:\Tools\Wincmd\tabs\TCupdates.tab\*.*
and opens the dir from the tab file on the other side.
[Edit]
I found the reason why my full install crashes with tab files
as command line parameter.
The Wlx plugin xBaseView had the .tab extension assigned.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2Horst.Epp

Could you perhaps post your tab file?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

petermad wrote:2Horst.Epp

Could you perhaps post your tab file?
As said above the culprint was the Wlx plugin xBaseView.
Here a the tab file which crashes TC when this plugin has the extension tab assigned:

Code: Select all

[activetabs]
[inactivetabs]
0_path=C:\Tools\Wincmd\
0_options=1|3|1|0|0|0|0
activetab=0
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

An empty [activetabs] section is not what TC would create by itself.

Regards
Holger
Make our planet great again
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

HolgerK wrote:An empty [activetabs] section is not what TC would create by itself.

Regards
Holger
No, but it was necessary to avoid TC loop in certian situations.
Christian can easiely avoid such recursion by checking that the new current dir in a tab is the same as the previous one and don't execute Aoto-run action in this case. But unfortunately he refused to check such possible loops.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
Post Reply