Page 1 of 5

[Implemented in Tc11.03rc3] [Tc11] Suggestion: COMMANDER_INI_PATH

Posted: 2023-05-10, 10:25 UTC
by JOUBE
Suggestion:

Next to the environment variables
COMMANDER_DRIVE
COMMANDER_EXE
COMMANDER_INI
COMMANDER_INSTANCE
COMMANDER_PATH
still missing (more and more):

COMMANDER_INI_PATH

Please implement it in TC11

JOUBE

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Posted: 2023-05-10, 10:36 UTC
by Gral
While i'm not against this request, note that has been discussed and

Code: Select all

%COMMANDER_INI%\..\
works for most cases.

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Posted: 2023-05-10, 11:08 UTC
by JOUBE
Gral wrote: 2023-05-10, 10:36 UTC While i'm not against this request, note that has been discussed and

Code: Select all

%COMMANDER_INI%\..\
works for most cases.
I know it. And in wincmd.ini you can use relative path (e.g. RedirectSection=xyz.ini), but I could like it for batches at the customer side. *)

JOUBE

*) without explanations...

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Posted: 2023-05-10, 11:21 UTC
by beb
JOUBE wrote: 2023-05-10, 11:08 UTC ...but I could like it for batches at the customer side...
2JOUBE

[WDX] Autorun Plugin: Run commands/set envvars on TC start:
https://www.ghisler.ch/board/viewtopic.php?t=32427

autorun.cfg:

Code: Select all

SetEnv /EV COMMANDER_INI_PATH %COMMANDER_INI%\..\

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Posted: 2023-05-10, 11:40 UTC
by Horst.Epp
beb wrote: 2023-05-10, 11:21 UTC [WDX] Autorun Plugin: Run commands/set envvars on TC start:
https://www.ghisler.ch/board/viewtopic.php?t=32427

autorun.cfg:

Code: Select all

SetEnv /EV COMMANDER_INI_PATH %COMMANDER_INI%\..\
That produces the following variable content
COMMANDER_INI_PATH=C:\Tools\Wincmd\wincmd.ini\..\

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Posted: 2023-05-10, 12:25 UTC
by beb
Horst.Epp wrote: 2023-05-10, 11:40 UTC That produces the following variable content
And what?
Now you just have %commander_ini_path% desired variable, refer to it, and otherwise use it as you want.
Check dir %commander_ini_path%, echo 'Hi'>%commander_ini_path%\test.txt commands for instance, and so on.

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Posted: 2023-05-10, 12:59 UTC
by Horst.Epp
beb wrote: 2023-05-10, 12:25 UTC
Horst.Epp wrote: 2023-05-10, 11:40 UTC That produces the following variable content
And what?
Now you just have %commander_ini_path% desired variable, refer to it, and otherwise use it as you want.
Check dir %commander_ini_path%, echo 'Hi'>%commander_ini_path%\test.txt commands for instance, and so on.
Sorry, this is nonsense.
There is no benefit to get this result
which its the same as using %COMMANDER_INI%\..\
from any tool or batch started from TC.

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Posted: 2023-05-10, 13:11 UTC
by Gral
There is nothing to discuss if user making such a suggestion is not satisfied with the existing workarounds.
So without much enthusiasm as I don't need it but I support it

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Posted: 2023-05-10, 14:31 UTC
by beb
Horst.Epp wrote: 2023-05-10, 12:59 UTC Sorry, this is nonsense.
If you aren't this happy to seeing the dot-slash part there there're also other ways, e.g.:
autorun.cfg:

Code: Select all

SetEnv /EV COMMANDER_INI_PATH %"StrLeft(%COMMANDER_INI%, StrLen(%COMMANDER_INI%) - 11)"
It will bring you a clear value (COMMANDER_INI_PATH=C:\Tools\Wincmd respecting your specific example).
Gral wrote: 2023-05-10, 13:11 UTC So without much enthusiasm as I don't need it but I support it
I would be glad to support it too, but my similar suggestion just had been ignored (viewtopic.php?t=77608).

So I've simply ended up living used to the workarounds :)

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Posted: 2023-07-24, 06:59 UTC
by JOUBE
Unfortunately, the display of the blue ticks in the directory hotlist does not work if \..\ is included in the path.

It would be good if that is added ("realpath").

Apart from that, it would of course be easier for paths pointing into the tc configuration if the variable COMMANDER_INI_PATH was present (instead use of %COMMANDER_INI%\..\)

Joube

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Posted: 2023-07-25, 06:28 UTC
by Fla$her
I didn't want to bring up the topic earlier, but since the need arose, I should still point out the beb error. The correct command is:

Code: Select all

SetEnv COMMANDER_INI_PATH %'StrLeft(COMMANDER_INI, StrPos(COMMANDER_INI, "\", -1) - 1)'

Re: Behavior of: %COMMANDER_INI%\..

Posted: 2023-11-09, 22:42 UTC
by Fla$her
not have a %COMMANDER_INI_PATH% variable
Controversial question, _PATH or _PARENT?
C:\totalcmd\wincmd.ini — isn't that the file path?

Moderator message from: petermad » 2023-11-11, 19:56 UTC

Moved this and the folowing 7 posts from "Behavior of: %COMMANDER_INI%\.." in "Total Commander [English]" to this topic

Re: Behavior of: %COMMANDER_INI%\..

Posted: 2023-11-09, 23:03 UTC
by Sir_SiLvA
Fla$her wrote: 2023-11-09, 22:42 UTC C:\totalcmd\wincmd.ini — isn't that the file path?
No, c:\totalcmd\ is the filepath and C:\totalcmd\wincmd.ini is the filepath+name.

Re: Behavior of: %COMMANDER_INI%\..

Posted: 2023-11-09, 23:11 UTC
by Fla$her
folder path = the path to the directory
file path = the path to the file
No? See .vbs:

Code: Select all

With CreateObject("Scripting.FileSystemObject")

  With .GetFile("C:\WINDOWS\System32\find.exe")
    MsgBox .Path               ' file path
    MsgBox .ShortPath          ' short file path
    MsgBox .ParentFolder.Path  ' parent folder path
  End With

  ' BuildPath method get full name:
  MsgBox .BuildPath("C:\Folder", "FileName.ext")

End With

' Path property get full name:
MsgBox CreateObject("Shell.Application").NameSpace(0).ParseName("Totalcmd.exe.lnk").GetLink.Path

Behaviour of the CD command

Posted: 2023-11-10, 02:03 UTC
by petermad
Fla$her wrote: 2023-11-09, 22:42 UTC Controversial question, _PATH or _PARENT?
C:\totalcmd\wincmd.ini — isn't that the file path?
I understand %COMMANDER_INI_PATH% as the path to the folder where all TC's ini files are located (wincmd.ini, wcx_ftp.ini contplug.ini fsplugin.ini pkplugin.ini fsplugin.ini usercmd.ini etc.). the file path to C:\totalcmd\wincmd.ini we already have as %COMMANDER_INI%