Fla$her wrote: 2022-08-26, 01:44 UTC
white wrote: 2022-08-26, 01:03 UTCAnd this is how it was added in Windows Commander 3.50:
10 years before the appearance of UAC, as a result of which these problems with elevating rights arose.
I wanted to show what the purpose of the parameter is, which is relevant now.
The introduction of the UAC didn't cause the problem you describe in your first post. The option OnlyOnce=1 was introduced very early on in the development of TC (then Windows Commander). It allowed only one running copy at the time. That behavior didn't change with the arrival of administrator accounts and normal accounts and the ability to run programs as a different user. If you had set OnlyOnce to 1 and had TC running elevated (before UAC that was every program run by an administrator) and would then run TC as a normal user passing paths as parameters. Tough luck, the paths couldn't be passed to the running TC and no new instance was created. The same when you had set OnlyOnce to 0 (or 1) and used parameter /O.
The situation remained the same with the arrival of UAC. UAC only made it harder to run programs elevated.
Then came TC 7.55 which introduced the behavior we see today. The default became to create an extra instance in the scenarios described above. If you have set OnlyOnce to 1 and have TC running elevated, running TC non-elevated creates a new non-elevated instance of TC. Likewise if you set OnlyOnce to 0 and run TC non-elevated with the /O switch. Regardless of any parameters.
If you want the old behavior you can set OnlyOnce to -1. Except that that doesn't work for the /O switch, which is the problem you reported.
All of this is not very well described in the Help. The Help about /O remained the same since it was added with Windows Commander 3.50. Only this was added to the Help about OnlyOnce to describe all of this:
Onlyonce=0 1: Start only one instance of Total Commander per user (e.g. started via RunAs)
-1: Start only one instance of Total Commander on this computer (for all users)
x>0: Same as 1, but multiple allowed per user
x<0: Same as -1, but multiple allowed on that computer (all users together)
First of all, it is good to understand that "on this/that computer" is poorly chosen. Replace that with "in the current logon session".
Also, the word "user" has been very poorly chosen to indicate "user account type" (Administrator or Standard). And actually should be described in terms of elevated/non-elevated. It never meant user.
Furthermore, it doesn't explain that only when you run TC non-elevated and a previous instance would be activated and that previous instance is elevated, and only if all already running instances are elevated, that a new instance can be created.
Example:
- Set OnlyOnce to 2.
- Run TC non-elevated.
- Run another instance of TC, this time elevated (this is now the last active one).
- Run another TC with parameter /O.
Now the elevated instance of TC is activated. If paths were also specified, those can not be passed to the elevated instance.
If you do these steps again, but replace step 2 with running TC elevated, then a new instance will be created.
It is also not explained that, if for example OnlyOnce is set to 3, the maximum number of instances is 3 to 6 depending on circumstances.
If you start 3 elevated instances first, you can add 3 non-elevated instances. (max 6)
But if you start 3 non-elevated instances first, you can add zero non-elevated instances. (max 3, non-elevated instance is activated instead)
When OnlyOnce is set to -3, then the maximum number of instances is 3 to 4.
A fourth instance is only possible when running 3 elevated instances and then running TC non-elevated with parameter /O. You know, because of the /O thing you talk about in the first post of this thread.
ghisler(Author) wrote: 2022-08-26, 07:03 UTC
white words it as if I changed this deliberately to piss off people, but that isn't my intention.
Of course not. I think it is probably an unintentional side effect which you now approve of. I just don't agree with your reasoning and I am passionate in making my argument. That's all.
ghisler(Author) wrote: 2022-08-26, 07:03 UTC
The main idea of /O is opening directories, if possible in an already running instance, otherwise in a new instance. It's not meant to prevent the launching of a second instance at all cost, that would need a new parameter.
/O is meant to activate the previous instance that was last active. That's how the program works. That's how it is described by you in command line syntax, help text and texts in history files.