Override only one instance if started from another user

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Override only one instance if started from another user

Post by *MVV »

Suggestion is simple: if 'only one instance' is used, when new TC instance is started and finds existing instance, if existing instance started by another user (or with different eleavtion level), new instance started anyway.

This may be used e.g. to start elevated TC by TC link if non-elevated already started, or to start new TC instance from admin account (currently if I use runas and start TC with admin rights, it finds started TC with user rights, activates it and closes).

Of course, feature may be optional, but I think it will be useful in most of cases.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Interesting idea, what do other users think about it?
Author of Total Commander
https://www.ghisler.com
User avatar
wanderer
Power Member
Power Member
Posts: 1575
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Post by *wanderer »

ghisler(Author) wrote:Interesting idea, what do other users think about it?
I always thought 'only one instance' was 'per user'! I'm surprised it isn't. I believe MVVs suggestion is nice. If someone doesn't like the idea, perhaps there could be another INI setting, named 'only one instance per user' to do the job.
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3
x64: Clients/Servers from Win7 to Win11 and Win2K12Srv to Win2K22Srv, mainly Win10 though.
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

wanderer wrote:I always thought 'only one instance' was 'per user'!
As far as I can tell from multi-user systems, the option 'Allow only 1 copy of Total Commander at a time' actually means one Total Commander instance per Windows session.
You can determine the session ID with the help of Windows Task Manager or with the help of Sysinternals Process Explorer e.g.

I am curious to learn whether implementing MVV's suggestion will have any negative impact on multi-user environments where several users can be running their Total Commander instances at the same time, although the option 'Allow only 1 copy of Total Commander at a time' is active, because each of the users has got his/her own Windows session.

Karl
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Well, TC just enumerates the top level windows and looks for the class name "TTOTAL_CMD". If it's found, it will be activated, otherwise the new copy will continue to load. TC could count the windows instead of just looking for the first. When using separate sessions, the windows from other sessions will not be visible.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Nice, TC 7.55b1 opens another instance under another user even if 'only one instance' is used. :)
And, in Windows 7 non-elevated TC starts even if elevated one is already running. :)
But in Windows 7 elevated TC doesn't start if non-elevated one already running - but it would be great to have such feature. :cry:
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Have a look at this (help about wincmd.ini):
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)
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Thanks, I'va saw note about OnlyOnce parameter in history.txt - I'm reading it right now. :)
wiperr
Junior Member
Junior Member
Posts: 8
Joined: 2013-07-27, 16:33 UTC

Just a question

Post by *wiperr »

There is no cm_ command for Onlyonce? As in, to toggle it via hothey?

I've noticed it works when you manually edit the Settings file while TC is running, so I guess it's 'toggleable'...

I mean, if you want to open two TC instances and keep it limited at that.

Or I'm missing the cm_ somewhere?
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

wiperr,
If you need to start another TC instance and ignore limits, just use /N command line option, there is no need to change TC settings.
Post Reply