Can you add a cm command to restart TC?
Moderators: Hacker, petermad, Stefan2, white
Can you add a cm command to restart TC?
I usually use tcimg to restart TC, but sometimes it will not start after TC is closed.
Re: Can you add a cm command to restart TC?
I have these commands in my usercmd.ini file:
then I can user either of the two em commands in Buttonbar, Keyboard shortcuts, Main Menu, Start Menu or Directory Hotlist
Code: Select all
[em_newcommander]
cmd=%COMSPEC% /C
param=%Z%X start "" "%%COMMANDER_EXE%%" /N /P /A /i="%%COMMANDER_INI%%" %P%N* %T%M*
menu=Open new instance of Total Commander with current directories
button=%COMMANDER_EXE%
iconic=1
[em_restartcommander]
cmd=em_newcommander, cm_Exit
button=%COMMANDER_EXE%
menu=Restart Total Commander with current directories
button=%COMMANDER_EXE%
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Can you add a cm command to restart TC?
THANK you very much for thispetermad wrote: 2022-09-07, 17:47 UTC then I can user either of the two em commands in Buttonbar, Keyboard shortcuts, Main Menu, Start Menu or Directory Hotlist

I have been using ReloadTC till now which never worked for tc64 but this is perfect.
(PS: is there anyway to make TC load usercmd.ini from a userdefined folder like %Commander_Path%\Inis ?)
Hoecker sie sind raus!
Re: Can you add a cm command to restart TC?
No - TC will load it from the same directory as the current wincmd.ini file (location can be seen via the Menu: "Help" -> "About Total Commander".(PS: is there anyway to make TC load usercmd.ini from a userdefined folder like %Commander_Path%\Inis ?
But if you start TC like this:
Code: Select all
drive:\path\totalcmd64.exe /i=drive:\path\inis\wincmd.ini /f=drive:\path\inis\wcx_ftp.ini
Notice you cannot use %Commander_Path% until TC is started (unless you have added it to Windows' environment manually).
The location of plugin ini files can be controlled in the [ReplaceIniLocation] section of your wincmd.ini file
Example:Help wrote:[ReplaceIniLocation] Set a different ini file location for specific plugins, via function *SetDefaultParams, parameter DefaultIniName, via line pluginfile.ext=c:\path\newinifile.ini or pluginfile.ext=c:\path\ - the plugin may ignore the name and just use the path.
pluginname.ext= New location of ini file sent to the plugin. The plugin name must be specified without path, and with extension as configured in wincmd.ini, e.g. sftpplug.wfx
Special values:
* send default value, but redirect to user profile if location not writable (default for packer, file system, and lister plugins)
- send default value, but do not redirect to user profile on fail (default for content plugins)
Code: Select all
[ReplaceIniLocation]
cloudplugin.wfx=%COMMANDER_PATH%\PLUGINS\wfx\cloudplugin\tccloud.ini
sftpplug.wfx=%COMMANDER_PATH%\PLUGINS\wfx\sftpplug\sftpplug.ini
CHMDir.wcx=%COMMANDER_PATH%\PLUGINS\wcx\CHMDir\CHMDir.ini
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Can you add a cm command to restart TC?
Thanks again I somehow missed [ReplaceIniLocation] when I read the history filepetermad wrote: 2022-09-08, 00:15 UTCNo - TC will load it from the same directory as the current wincmd.ini file (location can be seen via the Menu: "Help" -> "About Total Commander".(PS: is there anyway to make TC load usercmd.ini from a userdefined folder like %Commander_Path%\Inis ?
Example:Code: Select all
[ReplaceIniLocation] cloudplugin.wfx=%COMMANDER_PATH%\PLUGINS\wfx\cloudplugin\tccloud.ini sftpplug.wfx=%COMMANDER_PATH%\PLUGINS\wfx\sftpplug\sftpplug.ini CHMDir.wcx=%COMMANDER_PATH%\PLUGINS\wcx\CHMDir\CHMDir.ini

Also I only have decThumbsDBViewer.wlx (old and only 32Bit) and tcwebdav.wfx (by Chris)
as "bad boys" who save their inis in the wrong folder

PS:
1) I guess CHMDir.wcx was just an example because mine has its ini in its own folder
2) In my wincmd.ini under [Configuration] I have the key ‹L$÷A=6029370 you wouldnt by any change know what that is?
Hoecker sie sind raus!
Re: Can you add a cm command to restart TC?
2Sir_SiLvA
Sorry I have no idea - I doubt very much that it is TC that has put it there.In my wincmd.ini under [Configuration] I have the key ‹L$÷A=6029370 you wouldnt by any change know what that is?
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
-
- Junior Member
- Posts: 79
- Joined: 2022-06-16, 23:37 UTC
Re: Can you add a cm command to restart TC?
2petermad
Thank You!
Great solution. And what about fast switching between TCх32 and TCх64?
Thank You!
Great solution. And what about fast switching between TCх32 and TCх64?
Re: Can you add a cm command to restart TC?
While in the x64 version I use this button to start an x32 instance.
Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_PATH%\TOTALCMD.EXE
%Z/N %X"%P" "%T"
%COMMANDER_PATH%\TOTALCMD.EXE
TC x86
0
-1
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: Can you add a cm command to restart TC?
May I suggest to modify this to:Horst.Epp wrote: 2022-10-02, 08:56 UTC While in the x64 version I use this button to start an x32 instance.Code: Select all
TOTALCMD#BAR#DATA %COMMANDER_PATH%\TOTALCMD.EXE %Z/N %X"%P" "%T" %COMMANDER_PATH%\TOTALCMD.EXE TC x86 0 -1
Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_PATH%\TOTALCMD.EXE
%Z /N /P %X %P%N* %T%M*
%COMMANDER_PATH%\TOTALCMD.EXE
TC x86
0
-1
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Can you add a cm command to restart TC?
Thanks petermad
Much better than my version.
You are still the best

Much better than my version.
You are still the best
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: Can you add a cm command to restart TC?

License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
-
- Junior Member
- Posts: 79
- Joined: 2022-06-16, 23:37 UTC
Re: Can you add a cm command to restart TC?
2Horst.Epp, 2petermad
Thanks! But I mean, one button, which change version TC "round trip". If executed Totalcmd.exe then start Totalcmd64.exe, and if executed Totalcmd64.exe then start Totalcmd.exe (one button!).
There is such an implementation in the mentioned TCIMG.
Thanks! But I mean, one button, which change version TC "round trip". If executed Totalcmd.exe then start Totalcmd64.exe, and if executed Totalcmd64.exe then start Totalcmd.exe (one button!).
There is such an implementation in the mentioned TCIMG.
Re: Can you add a cm command to restart TC?
Not a scenario which makes sense for me.monarch-lfv wrote: 2022-10-02, 11:45 UTC 2Horst.Epp, 2petermad
Thanks! But I mean, one button, which change version TC "round trip". If executed Totalcmd.exe then start Totalcmd64.exe, and if executed Totalcmd64.exe then start Totalcmd.exe (one button!).
There is such an implementation in the mentioned TCIMG.
I always use the x64 version and only for some tests
or using an old 32bit plugin I start the x86 version.
After stopping this I'm still in the x64 TC.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: Can you add a cm command to restart TC?
2monarch-lfv
Code: Select all
;:::::::::::::::::::::: AU3 :::::::::::::::::::::::
; Restarting TC switching the x32<>x64 architecture
; Parameter in the Command field: "%COMMANDER_EXE%"
; Release date: 05/03/2019
;::::::::::::::::::::::::::::::::::::::::::::::::::
#NoTrayIcon
Local $hWnd = WinActive("[CLASS:TTOTAL_CMD]")
If $hWnd Then
Opt("WinWaitDelay", 40)
Local $TC = $CmdLine[1], $PFix = '', $n = 4
WinClose($hWnd)
ProcessWaitClose(WinGetProcess($hWnd))
If @OSArch <> 'x86' Then
If StringRight($TC, 6) = '64.EXE' Then
$n = 6
Else
$PFix = '64'
EndIf
EndIf
$PID = Run(StringLeft($TC, StringLen($TC) - $n) & $PFix & '.EXE')
WinWaitActive("[CLASS:TTOTAL_CMD]")
$WSS = ObjCreate('WScript.Shell')
$WSS.AppActivate($PID)
EndIf
Overquoting is evil! 👎
Re: Can you add a cm command to restart TC?
To make a toggle-button do this:monarch-lfv wrote: 2022-10-02, 11:45 UTC Thanks! But I mean, one button, which change version TC "round trip". If executed Totalcmd.exe then start Totalcmd64.exe, and if executed Totalcmd64.exe then start Totalcmd.exe (one button!).
There is such an implementation in the mentioned TCIMG.
Put this command in your usercmd.ini file (located in the same dir as your wincmd.ini file, if not present make it):
Code: Select all
[em_othercommander]
cmd=%COMSPEC% /C
param=%Z%X if "%%COMMANDER_EXE%%"=="%%COMMANDER_PATH%%\TOTALCMD.EXE" (start "" "%%COMMANDER_PATH%%\TOTALCMD64.EXE" /N /P /A /i="%%COMMANDER_INI%%" %P%N* %T%M*) else start "" "%%COMMANDER_PATH%%\TOTALCMD.EXE" /N /P /A /i="%%COMMANDER_INI%%" %P%N* %T%M*
menu=Open opposite bitness of Total Commander
button=%COMMANDER_EXE%
iconic=1
Code: Select all
TOTALCMD#BAR#DATA
em_othercommander, cm_Exit
%COMMANDER_EXE%
Open opposite bitness of Total Commander
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".
For this to work the 64bit and the 32bit version of TC of course has to be installed in the same directory.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar