Page 1 of 1

Override only one instance if started from another user

Posted: 2010-01-17, 09:37 UTC
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.

Posted: 2010-01-18, 20:17 UTC
by ghisler(Author)
Interesting idea, what do other users think about it?

Posted: 2010-01-19, 09:44 UTC
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.

Posted: 2010-01-19, 21:03 UTC
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

Posted: 2010-01-21, 20:24 UTC
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.

Posted: 2010-03-26, 08:00 UTC
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:

Posted: 2010-03-26, 08:33 UTC
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)

Posted: 2010-03-26, 08:45 UTC
by MVV
Thanks, I'va saw note about OnlyOnce parameter in history.txt - I'm reading it right now. :)

Just a question

Posted: 2016-08-24, 12:31 UTC
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?

Posted: 2016-08-25, 10:27 UTC
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.