Page 2 of 5

Re: Can you add a cm command to restart TC?

Posted: 2022-10-02, 13:04 UTC
by Fla$her
2petermad
There is a big disadvantage in your solutions — the lack of waiting for the program to close, which as a result causes a number of conflicts for resident modules (Autorun + ShellExecute, TWinKey > Miscellaneous > Startup Sequence).
It is also important to consider the architecture of the system for compatibility.
There is another important point that I implemented in my other old code: returning to directories that were opened in partially blocked tabs. But these are the details that are important to me and some other users.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-02, 14:17 UTC
by petermad
the lack of waiting for the program to close, which as a result causes a number of conflicts for resident modules (Autorun + ShellExecute, TWinKey > Miscellaneous > Startup Sequence).
I don't have any of those running, so I cannot test it. But you can put in a wait periond (cm_Wait 500) before cm_Exit maybe that can help? It will change the instance number of the running TC though.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-02, 14:37 UTC
by Fla$her
petermad wrote: 2022-10-02, 14:17 UTCI don't have any of those running, so I cannot test it.
Just take my word for it. I have devoted enough time to this in my time.
petermad wrote: 2022-10-02, 14:17 UTCBut you can put in a wait periond (cm_Wait 500) before cm_Exit maybe that can help?
Under different conditions, a small delay is not suitable for a universal restart, therefore, in my code there is a waiting for the process to complete.
petermad wrote: 2022-10-02, 14:17 UTCIt will change the instance number of the running TC though.
On the contrary, the instance number will correspond to the last one that was completed.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-02, 14:50 UTC
by Horst.Epp
Whats the reason for swapping the TC version instead of running both versions in parallel
if the x86 version is needed ?

Re: Can you add a cm command to restart TC?

Posted: 2022-10-02, 15:26 UTC
by Fla$her
2Horst.Epp
First of all, the reason is the lack of need to keep several subprocesses and avoid conflicts between them.
As a rule, the user does not need an instance with another of the architectures, if everything suits him. However, for experiments and problems related to memory, the presence of plugins or programs that do not support compatibility, we have to temporarily resort to a different architecture.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-02, 22:48 UTC
by petermad
2Fla$her
On the contrary, the instance number will correspond to the last one that was completed
I meant with my solution and adding cm_Wait - not with your solution

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 05:08 UTC
by monarch-lfv
2Fla$her
Thanks for the script AutoIT, but I have TCIMG (it's defacto Autoit too) already.
I have the autorun plugin with some settings but haven't noticed any problems (solution by petermad).

2petermad
Thanks, this is what I need. Works faster than TCIMG.
But I didn’t understand why the second instance of the program starts first, and then exits the first one? What's wrong with this code?:

Code: Select all

cm_Exit, em_othercommander
This works, because the list of commands must be completed in full. For example delay:

Code: Select all

cm_exit, cm_wait 2000, em_othercommander
- Works, but the cursor locations in the panels are reset. That is, it is better not to turn on the delay, without delay - ok.

2Horst.Epp
I have a system Win7x64 (at home) Win10x64 (at work), I use TCx32, because I have repeatedly noticed bugs that lead to the crash TCx64, while the TCx32 worked fine. In general, I think that TCx32 is more stable. Also in TCx32 there are old necessary plugins that are not on TCx64.
TCx64 has other benefits, such as showing thumbnails of documents for 64-bit applications.
Sometimes I have to switch, I set it up for myself like this:
Alt + Pause - Restart TC
Alt +Shift+Pause - TCx32 <-> TCx64
It's convenient and very fast for me.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 05:55 UTC
by Fla$her
petermad wrote: 2022-10-02, 22:48 UTCI meant with my solution and adding cm_Wait - not with your solution
Oh, I see. You wrote "though". ОК.

monarch-lfv wrote: 2022-10-03, 05:08 UTCit's defacto Autoit too
The algorithm itself is important, not the tool.
monarch-lfv wrote: 2022-10-03, 05:08 UTCI have the autorun plugin with some settings but haven't noticed any problems (solution by petermad).
It's not any settings that are important, but specifically the launch and termination of programs (+ /T Or /TT), the execution of commands (including registry editing) after the AutorunFinalizeSection directive.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 07:46 UTC
by monarch-lfv
2Fla$her
You're right, I don't have those options (+ /T Or /TT). But at the same time, I have several programs that start with the TC. But these programs are not closed when the total is exited (for what should the processor be loaded when the TC is restarted). Implemented like this:

Code: Select all

ShellExec "%COMMANDER_PATH%\Plugins\wdx\Autorun\Autorun_program.vbs"
That is, I give all the difficulties to scripts. There is also a separate script that kills all processes running from the %COMMANDER_PATH% directory (of course does not start with the Autorun).

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 08:26 UTC
by Fla$her
2monarch-lfv
I wrote about universality. I don't understand why run programs through a script that runs from autorun? Why is there an extra layer? And what kind of difficulties are you talking about?
A script that does something separate from the directive has nothing to do with the case.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 09:00 UTC
by monarch-lfv
Fla$her wrote: 2022-10-03, 08:26 UTC what kind of difficulties are you talking about?
There are features of launching some programs. Basically, these are utilities placed in the tray. That is, if the program is already running (it is in the tray and in processes), then its subsequent launch opens the main settings window (for example, XMouseButtonControl). Other programs, when restarted, display a dialog box warning that the program is already running (for example, Greenshot). And this is what I need to avoid. Therefore, in the script I do process tracking, if the process exists, then the launch is not carried out.
At the first start of the Total, all the applications I need are launched and are constantly in the tray. They do not depend on Total restarts in any way.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 09:12 UTC
by ghisler(Author)
The next Total Commander will support restart via command:
CM_EXIT 1
This will start TC with parameter /N after saving paths on exit (if this is enabled by the user). It will also pass parameters /i= and /f= for the ini files if they were passed to the running program. Anything else?

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 09:27 UTC
by monarch-lfv
2ghisler(Author)
Yes, if possible - restart with switch versions TCx32 <-> TCx64. Thank you!

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 10:07 UTC
by Fla$her
monarch-lfv wrote: 2022-10-03, 09:00 UTCTherefore, in the script I do process tracking, if the process exists, then the launch is not carried out.
That's what I'm writing about. What's the point of doing this in a script if you can do it without problems via autorun.cfg using ProcessExist?
monarch-lfv wrote: 2022-10-03, 09:00 UTCAt the first start of the Total, all the applications I need are launched and are constantly in the tray. They do not depend on Total restarts in any way.
This is just a special case.
But when we use portable TC, then in the process of its completion (incl. before disconnecting the portable device) on other machines, it is required to close the running resident processes as well.
In addition, there are situations when the same resident script is tied to the handle of the process being completed for interaction only with it. Accordingly, there is no point in leaving it working. I have enough of them.
Or there are situations when one or another program is compared with the architecture of TC process, respectively, when restarting, replacement with the appropriate one is required.

Re: Can you add a cm command to restart TC?

Posted: 2022-10-03, 10:12 UTC
by Fla$her
ghisler(Author) wrote: 2022-10-03, 09:12 UTCAnything else?
Yes:
Fla$her wrote: 2022-10-02, 13:04 UTCreturning to directories that were opened in partially blocked tabs.
If you do, it will be just wonderful! :P