How can I refer to the ini files location

English support forum

Moderators: Hacker, petermad, Stefan2, white

HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

An additional interesting thing (according to me) is as follows for a button definition :
- Command : %COMMANDER_INI%\..\UserSub.bar
- Start path : %COMMANDER_INI%\.\

Please attention to "\..\" and "\.\" :
Command requires two points, but, Start path requires one point!

I am not sure this is normal or not, I am not so experienced about relative paths...
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

HBB wrote:- Command : %COMMANDER_INI%\..\UserSub.bar
- Start path : %COMMANDER_INI%\.\
Please attention to "\.." and "\." :
Command requires two points, but, Start path requires one point!
Only partially correct.
The command "%COMMANDER_INI%\..\UserSub.bar" requires two dots, correct, provided the UserSub.bar is located in the same folder as the wincmd.ini file.
The start path is syntactically incorrect, because you cannot refer to a file by using a single dot. Yet, as the start path is not needed in this case at all, the incorrect start path will not do any harm.

Karl
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

HBB wrote:To Mikefield :
You can find Image of "set c"
The screenshot reveals that you somehow managed to confuse T.C. and/or Windows, because %COMMANDER_INI% resolves to C:\windows\P:/Files/Programs/Totalcmd/wincmd.ini.
This fully qualified filename is pretty obviously nonsense.

Perhaps you should simply stick to the Windows rule that the path separator is the backslash.

Karl
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

Hello karl,
The screenshot reveals that you somehow managed to confuse T.C. and/or Windows
Linux + Windows = confusing "\" and "/". This is a mistake for windows...
But, this kind of mistakes may occur in some cases, programs may be carefull about them. In fact, TC was mostly succesfull, because it resolved wincmd.ini for reading contents.
EDITED <<< Since it was succesfull, I couldn't detect my fault >>>
The start path is syntactically incorrect, because you cannot refer to a file by using a single dot
Did you try it? Please try...

Best regards
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, HBB.
The start path is syntactically incorrect, because you cannot refer to a file by using a single dot
Did you try it? Please try...
%COMMANDER_INI% is a fully qualified filename. E.g. it is
C:\>echo %COMMANDER_INI%
C:\Programme\Tc750\wincmd.ini
here.
A dot always refers to the current folder. I filename is not a folder. Hence %COMMANDER_INI%\. is an invalid object.
C:\>cd %COMMANDER_INI%\.
The foldername is invalid.
But
C:\>cd %COMMANDER_INI%\..
C:\Programme\Tc750>
Conclusion:
A correct start path for your command would be %COMMANDER_INI%\.. %COMMANDER_INI%\. is not a valid start path. It is not a valid foldername at all.
T.C. will ignore the invalid start path. As the commandline holds a fully qualified valid filename %COMMANDER_INI%\..\UserSub.bar in you case the start path can be safely ignored and left blank.

Kind regards,
Karl
-
P.S.:
%COMMANDER_PATH%\.. is a dirty little trick that does work, whereas %COMMANDER_PATH%\. does not.
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

Hello Karl,

Please look at this. How can TC list the available folders by one single dot?

Kind regards,
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hi, HBB.

T.C. resolves %COMMANDER_II%\.\ like this:
+ %COMMANDER_II%\. is invalid and yields an empty string as a result
+ This leaves the single backslash \, i.e. the root folder of the drive.

Telling from your pathnames which we have learnt so far, what T.C. is showing you are foldernames which can be found in the root folder of your P: drive.

Kind regards,
Karl
--
P.S.:
I verified that this is how T.C. inteprets %COMMANDER_INI%\.\ by applying it to a button here on my system. I ended up being shown the files and folders located in the root folder of drive C:.
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

Hello Karl,

As I said before, I am not so experienced about relative paths.
You seem to be right, "%COMMANDER_INI%\.\" refers to root folder.
Edited >>> "%COMMANDER_INI%\..\" also refers to root folder

Very interesting, in my first attempt, I remember to see actually the folder of "wincmd.ini" in "Start path", but not now...

Anyway, thank you very much for your warnings and help.

Best regards...
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

Hello Karl,

Please watch this (or directly download swf)
Very interesting, in my first attempt, I remember to see actually the folder of "wincmd.ini" in "Start path", but not now...
"%COMMANDER_INI%\.\" for "Start Path" always show the active panel directory!
This misleaded me...

I think that TC needs the Christian's help.

Kind regards
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hi, HBB.

Sorry to say so, but you still seem to be missing the point:

%COMMANDER_INI%\.\ is a piece of crap, syntactical nonsense. When reading it, T.C. drops the senseless part, %COMMANDER_INI%\., and only keeps the meaningful rest. This is a single backslash. A single backslash alone used as a foldername always means the root folder of the current drive.
(Yet, I vaguely remember having explained all this before.)

%COMMANDER_INI%\..\ does not always point to the root folder. It might point to the root folder on your system, but it definitely does not do so on mine (as can be told from one of my previous posts).
Yet, even on your system, %COMMANDER_INI%\.. should not point to any root folder, because your wincmd.ini file is located here: P:\Files\Programs\TotalCmd\wincmd.ini.
Therefore %COMMANDER_INI%\.. should point here on your system: P:\Files\Programs\TotalCmd.
This is true provided your %COMMANDER_INI% variable holds the correct value by now and no longer the garbled string that used to be in it.

Kind regards,
Karl
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

Hi Karl,

%COMMANDER_INI% behaves as you described, this is OK. I tried this by batch files, no problem...

But, in button editor, a wrong dropdown menu is listed when "%COMMANDER_INI%\..\" is written into "Start Path".
I am trying to say this may cause a misunderstanding as I did.

According to me, TC should show correct drop down list (or no dropdown list if nonsense).

Best regards
User avatar
petermad
Power Member
Power Member
Posts: 16101
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

But, in button editor, a wrong dropdown menu is listed when "%COMMANDER_INI%\..\" is written into "Start Path".
Try %COMMANDER_INI%\.. without the quotation marks and the trailing backslash - that works for me.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply