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

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Fla$her
Power Member
Power Member
Posts: 2309
Joined: 2020-01-18, 04:03 UTC

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

Post 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.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post 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).
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2309
Joined: 2020-01-18, 04:03 UTC

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

Post 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.
Overquoting is evil! 👎
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

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

Post 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
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post 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).
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2309
Joined: 2020-01-18, 04:03 UTC

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

Post 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.
Overquoting is evil! 👎
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

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

Post 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
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
white
Power Member
Power Member
Posts: 4622
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

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

Post 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
Last edited by white on 2022-08-23, 08:54 UTC, edited 1 time in total.
Reason: Added: I used Windows Run to run TC
User avatar
white
Power Member
Power Member
Posts: 4622
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

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

Post by *white »

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

Moved to Bugs forum.
User avatar
petermad
Power Member
Power Member
Posts: 14807
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

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

Post 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.
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
Fla$her
Power Member
Power Member
Posts: 2309
Joined: 2020-01-18, 04:03 UTC

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

Post 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.
Last edited by Fla$her on 2022-08-22, 21:15 UTC, edited 1 time in total.
Overquoting is evil! 👎
User avatar
white
Power Member
Power Member
Posts: 4622
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

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

Post 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).
User avatar
petermad
Power Member
Power Member
Posts: 14807
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

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

Post 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.
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
Fla$her
Power Member
Power Member
Posts: 2309
Joined: 2020-01-18, 04:03 UTC

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

Post 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
Overquoting is evil! 👎
User avatar
white
Power Member
Power Member
Posts: 4622
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

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

Post 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.
Post Reply