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

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

JOUBE
Power Member
Power Member
Posts: 1481
Joined: 2004-07-08, 08:58 UTC

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

Post 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
Last edited by JOUBE on 2024-01-29, 18:05 UTC, edited 3 times in total.
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Post by *Gral »

While i'm not against this request, note that has been discussed and

Code: Select all

%COMMANDER_INI%\..\
works for most cases.
JOUBE
Power Member
Power Member
Posts: 1481
Joined: 2004-07-08, 08:58 UTC

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Post 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...
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Post 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%\..\
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6498
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Post 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\..\
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.3 x64
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Post 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.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6498
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Post 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.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.3 x64
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Post 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
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Post 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 :)
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
JOUBE
Power Member
Power Member
Posts: 1481
Joined: 2004-07-08, 08:58 UTC

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

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

Re: [Tc11] Suggestion: COMMANDER_INI_PATH

Post 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)'
Overquoting is evil! 👎
Fla$her
Power Member
Power Member
Posts: 2321
Joined: 2020-01-18, 04:03 UTC

Re: Behavior of: %COMMANDER_INI%\..

Post 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
Overquoting is evil! 👎
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3299
Joined: 2003-05-06, 11:46 UTC

Re: Behavior of: %COMMANDER_INI%\..

Post 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.
Hoecker sie sind raus!
Fla$her
Power Member
Power Member
Posts: 2321
Joined: 2020-01-18, 04:03 UTC

Re: Behavior of: %COMMANDER_INI%\..

Post 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
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14810
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Behaviour of the CD command

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