TC 11b5: explain to me how TC processes command line parameters?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Pawel
Junior Member
Junior Member
Posts: 82
Joined: 2018-12-18, 11:54 UTC
Location: Poland
Contact:

TC 11b5: explain to me how TC processes command line parameters?

Post by *Pawel »

@ghisler(Author),

Christian, could you (or someone else) explain to me how Total Commander processes command line parameters?

Here is an example of command line I use (for Windows AutoPlay). It should open Disk F: (it is my pendrive) in RIGHT PANEL in NEW Tab (also, TC should use configuration file wincmd.ini from different location).

"C:\Program Files (x86)\TC\TOTALCMD.EXE" /i="C:\TC_TEST\wincmd.ini" /O /T /R="F:"

Using above command line works only partially (Drive F: is opened correctly in new tab in right panel, but wincmd.ini directory is opened in left panel (C:\TC_TEST) - it should not!).

But, I know, in TC 10.52 parameter /O has changed:
Command line parameters: option /O now supports a parameter, e.g. /O0 to never open a new instance in any case

So, I made some tests, and it seems the following command line works as expected:
"C:\Program Files (x86)\TC\TOTALCMD.EXE" /i="C:\TC_TEST\wincmd.ini" /O1 /T /R="F:"
Drive F: is opened in new tab in right panel (in existing TC instance or in new TC instance (if was not opened). TC uses external configuration file. OK

Can you explain /O parameter options?
I know, if I use /O0 /T /R="F:" -> it will open disk F: in new tab in right panel ONLY if TC is already opened.

What else can I use? Help text is a bit incomprehensible for me...

/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). Now supports additional parameters:
0 Never open a new instance in any case. If none is running, do nothing.
number Same as value of OnlyOnce= in wincmd.ini (positive or negative value)
- Same as -1


Can I use /O-
or
/O-1
What it means?
Can I use /O2? What "number" means (/O0, /O1, O2...)?

Thanks for explanation!
-Pawel
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3278
Joined: 2003-05-06, 11:46 UTC

Re: TC 11b5 [Command line parameters]

Post by *Sir_SiLvA »

See the Help-file:

Code: Select all

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). Now supports additional parameters:
0 Never open a new instance in any case. If none is running, do nothing.
number Same as value of OnlyOnce= in wincmd.ini (positive or negative value)
- Same as -1
Hoecker sie sind raus!
Pawel
Junior Member
Junior Member
Posts: 82
Joined: 2018-12-18, 11:54 UTC
Location: Poland
Contact:

Re: TC 11b5 [Command line parameters]

Post by *Pawel »

@Sir_SiLvA
Ah, right... OnlyOnce option... It seems to be clear now.
Maybe (sugesstion) better to write help without referring to other options.

PARAMETER: /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).

0
Never open a new instance in any case. If none is running, do nothing.

1
Start only one instance of Total Commander per user (e.g. started via RunAs)
x>0
Same as 1, but multiple allowed per user
Notes: if 1 is one instance (per user) allowed, then x>0 should be maybe x>1?

-1 or -
Start only one instance of Total Commander on this computer (for all users)
x<0
Same as -1, but multiple allowed on that computer (all users together)
Notes: if -1 is one instance allowed (all users), then x<0 should be maybe x<-1?

So, in my case I need to use:
"C:\Program Files (x86)\TC\TOTALCMD.EXE" /i="C:\TC_TEST\wincmd.ini" /O1 /T /R="F:"

But, still - what means "multiple allowed on that computer" using for example this: /O3

-Pawel
User avatar
white
Power Member
Power Member
Posts: 4594
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: TC 11b5 [Command line parameters]

Post by *white »

2Pawel
You may want to look at this post and perhaps read the whole topic there.
Pawel
Junior Member
Junior Member
Posts: 82
Joined: 2018-12-18, 11:54 UTC
Location: Poland
Contact:

Re: TC 11b5 [Command line parameters]

Post by *Pawel »

@white
Thanks!
As I thought, this option seems to be very simple, but it is not :)
I see there was already discussions about it...
I stay with /O1
In my understanding:
- If no TC window is opened it will open new instance of TC with given path
- if TC window is already opened (not elevated) it will pass the path to already opened TC window
- if TC is already opened (elevated!) it will open new TC window (not elevated) with given path

also:
if there are more TC windows opened (for example: normal, normal, elevated), and last one IS elevated nothing will happen (path will not be passed from non-elevated process to elevated TC)
but
if there are more TC windows opened (for example: normal, elevated, normal) but last one IS NOT elevated it will pass the path to that last normal TC window
-Pawel
User avatar
white
Power Member
Power Member
Posts: 4594
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: TC 11b5 [Command line parameters]

Post by *white »

Pawel wrote: 2023-06-06, 05:18 UTC also:
if there are more TC windows opened (for example: normal, normal, elevated), and last one IS elevated nothing will happen (path will not be passed from non-elevated process to elevated TC)
but
if there are more TC windows opened (for example: normal, elevated, normal) but last one IS NOT elevated it will pass the path to that last normal TC window
Yes, but to be clear, the order in which you open TC instances doesn't matter, it matters which one was last active.
Post Reply