Page 2 of 7

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-19, 12:21 UTC
by Fla$her
2ghisler(Author)
Explain why you refuse to address this issue as proposed? Unclaimed calling a new instance is a significant problem. It cannot be ignored.

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-21, 08:02 UTC
by ghisler(Author)
Sorry, I will not allow to send messages from a program with normal rights to TC running with higher rights. I have already described how you can do this (launch the instance with the /O parameter also with higher rights).

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-21, 10:27 UTC
by Fla$her
2ghisler(Author)
I wrote an alternative option. Now we are talking about this:
Fla$her wrote: 2022-08-14, 07:53 UTCAs a last resort, I prefer a window that gives the right to choose to launch a separate instance. Or even ignore the launch as such. Otherwise, the use of the specified keys becomes meaningless.
ghisler(Author) wrote: 2022-08-21, 08:02 UTClaunch the instance with the /O parameter also with higher rights.
Please read my answer in full. The program is not to blame that Windows, after installing the autorun option, executes it without elevation. But your program is to blame for ignoring the ini key and /O parameter. Allow the user to determine whether it is profitable for him to run a second instance or not. Otherwise, ignoring this, you violating the given functionality and compatibility, causing conflicts between modules and resident programs that should not be duplicated.

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-21, 14:01 UTC
by Dalai
2ghisler(Author)
You still haven't answered my question about what OnlyOnce=-1 is supposed to do. The answer might be relevant to the topic being discussed. If OnlyOnce=-1 is supposed to work for all users of a computer, then it should do exactly that. If I understand Fla$her correctly, it doesn't currently. Maybe the TC help needs to describe more accurately what is supported and what is not supported.

Regards
Dalai

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-22, 07:25 UTC
by ghisler(Author)
OnlyOnce=1:
When an elevated copy of TC is already running, you can also run another, non-elevated copy. Otherwise you can't open a new copy.
So if you need both an elevated and normal copy, run the elevated copy first. Unfortunately it's not possible to do the reverse (run the normal copy first).

OnlyOnce=-1:
You can't open a second copy of TC, neither elevated or not, if one copy is already running (elevated or not).

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-22, 08:31 UTC
by Fla$her
ghisler(Author) wrote: 2022-08-22, 07:25 UTCOnlyOnce=-1:
You can't open a second copy of TC, neither elevated or not, if one copy is already running (elevated or not).
I started with the fact that this is not the case. The second copy starts anyway. But for some reason you ignored it.
Return the topic back to the desired subforum, please.

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-22, 17:28 UTC
by Dalai
OK, so OnlyOnce=-1 is supposed to work the way it's described in TC help, and also how I understood it. But according to Fla$her's findings TC does not behave this way. I haven't tested it myself, but on the asumption the findings are accurate, I consider the current TC behavior a bug.

Regards
Dalai

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-22, 18:39 UTC
by white
Dalai wrote: 2022-08-22, 17:28 UTC OK, so OnlyOnce=-1 is supposed to work the way it's described in TC help, and also how I understood it. But according to Fla$her's findings TC does not behave this way.
Confirmed. The /O parameter causes it.
  • Run: "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini
  • Close TC
  • Edit "C:\Test\tc.ini" to include the entry "OnlyOnce=-1"
  • Run: "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini (Ctrl+Shift+Enter)
  • Run: "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini /O (Enter)
Second instance is opened.

Edit:
I used Windows Run to run TC

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-22, 18:41 UTC
by white

Moderator message from: white » 2022-08-22, 18:40 UTC

Moved to Bugs forum.

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-22, 20:45 UTC
by petermad
Run: "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini (Ctrl+Shift+Enter)
Run: "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini /O (Enter)

Second instance is opened.
But isn't that in accordance with the Help file:
Help wrote:Command line parameters

/O
If Total Commander is already running, activate it and pass the path(s) in the command line to that instance (overrides the settings in the configuration dialog to have multiple windows)



Ini File Settings part 2: Configuration N-Z

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)
the only difference between 1 and -1 is that -1 applies to all users - it does not say anything about /O not overriding the setting when -1 is used in stead of 1.

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-22, 20:59 UTC
by Fla$her
2petermad
overrides = cancels = regardless of

Сan be refine:
If Total Commander is already running, this parameter activates it and passes the path(s) from the command line to this copy of the program (regardless of the configuration dialog setting that allows to open multiple Total Commander windows).
So it shouldn't be a setting that does the opposite.

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-22, 21:12 UTC
by white
petermad wrote: 2022-08-22, 20:45 UTC the only difference between 1 and -1 is that -1 applies to all users - it does not say anything about /O not overriding the setting when -1 is used in stead of 1.
It says it overrides when the setting is 0 (to have multiple windows).

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-23, 01:08 UTC
by petermad
Hmm, I read the sentence "overrides the settings in the configuration dialog to have multiple windows)" that it overrides any of the two settings (notice settings is plural): on or off.

But anyvay I tried this:
  • Run: "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini
  • Close TC
  • Edit "C:\Test\tc.ini" to include the entry "OnlyOnce=-1"
  • Run: "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini (Ctrl+Shift+Enter)
  • Run: "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini /O (Enter)
Second instance is opened.
And I never got a second instance with OnlyOnce=-1 in tc.ini

It is not clear if:
Run: "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini (Ctrl+Shift+Enter)
Run: "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini /O (Enter)
means whether I should run the them from TC's command line, or run thme from Windows' Run - so I tried both bot never got a second instance.

It is not clear either whether I should start TC with "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini and then perform
Run: "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini (Ctrl+Shift+Enter)
Run: "C:\Test\TOTALCMD64.EXE" /i=.\tc.ini /F=.\tcftp.ini /O (Enter)
but I tried this too without getting a second instance.

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-23, 07:15 UTC
by Fla$her
2petermad
Save Onlyonce=-1 in %COMMMANDER_INI% и and reload TC.
Explorer must have user rights, and TC, in turn, must have elevated rights. Is this condition met?
After that, press Win+R and run C:\Test\TOTALCMD64.EXE /O

Re: Opening a new instance of TC with /O from an application with other rights

Posted: 2022-08-23, 08:46 UTC
by white
If you can't start a second instance of TC when running it without parameters, then it definitely shouldn't when you add the /O parameter.