How can I refer to the ini files location

English support forum

Moderators: Hacker, petermad, Stefan2, white

aamoncad
Junior Member
Junior Member
Posts: 5
Joined: 2008-06-18, 16:14 UTC

How can I refer to the ini files location

Post by *aamoncad »

I want to refer to the ini files location because I'm doing a shortcut in the button bar that opens notepad++ (the editor I use) with the wincmd.ini, and I have to pass the path as a parameter, so I need to know how I refer to the ini locations files, but the relative path, like %COMMANDER_PATH% but the location of the ini files.

Thank's, I'll appreciate your help
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

%COMMANDER_INI%
aamoncad
Junior Member
Junior Member
Posts: 5
Joined: 2008-06-18, 16:14 UTC

Post by *aamoncad »

thank you very much
User avatar
petermad
Power Member
Power Member
Posts: 16101
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2aamoncad

Actually %COMMANDER_INI% is the ini file itself (with path) - if you want the path without the file name use: %COMMANDER_INI%\..
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
aamoncad
Junior Member
Junior Member
Posts: 5
Joined: 2008-06-18, 16:14 UTC

Post by *aamoncad »

I tried that but it doesn't work for me, I tried to edit the wcx_ftp.ini from a shortcut like this "notepad++ path" %COMMANDER_INI%\wcx_ftp.ini
it works when I edit the wincmd.ini like this "notepad++ path" %COMMANDER_INI%

??
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7010
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

aamoncad wrote:I tried that but it doesn't work for me, I tried to edit the wcx_ftp.ini from a shortcut like this "notepad++ path" %COMMANDER_INI%\wcx_ftp.ini
it works when I edit the wincmd.ini like this "notepad++ path" %COMMANDER_INI%

??
You have to use "%COMMANDER_INI%"\..wcx_ftp.ini
Note the " and the use of ..
aamoncad
Junior Member
Junior Member
Posts: 5
Joined: 2008-06-18, 16:14 UTC

Post by *aamoncad »

sorry, I tried "%COMMANDER_INI%"\..wcx_ftp.ini
but doesn't work yet
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

"%COMMANDER_INI%\..\wcx_ftp.ini" should do better. ;)
aamoncad
Junior Member
Junior Member
Posts: 5
Joined: 2008-06-18, 16:14 UTC

Post by *aamoncad »

it works perfect
THANK YOU VERY MUCH
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

When I run TC as follows :
P:\Programs\TotalCmd\TOTALCMD.EXE /I=%COMMANDER_DRIVE%/Files/Programs/TotalCmd/wincmd.ini /F=%COMMANDER_DRIVE%/Files/Programs/TotalCmd/wcx_ftp.ini

And when I put a button into button bar as follows :
cd %COMMANDER_INI%\..\

Then I press that button, active panel goes to c:\WINDOWS\
What is my fault here? Is there anyone who have any idea?

OS: WinXP SP3
InstallDir=P:\Programs\TotalCmd
UseIniInProgramDir=7
Edited >> TC7.5 Final
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, HBB.
When I run TC as follows :
P:\Programs\TotalCmd\TOTALCMD.EXE /I=%COMMANDER_DRIVE%/Files/Programs/TotalCmd/wincmd.ini /F=%COMMANDER_DRIVE%/Files/Programs/TotalCmd/wcx_ftp.ini
T.C. will not use the INI-files which you expect.
Reason:
You cannot use variables like %COMMANDER_PATH% and %COMMANDER_DRIVE% outside of T.C. They mean nothing to Windows.
To find out which INI-files the running T.C. instance uses, go to Help => About.
And when I put a button into button bar as follows :
cd %COMMANDER_INI%\..\
Then I press that button, active panel goes to c:\WINDOWS\
because T.C. uses a wincmd.ini inside the Windows folder really? To find out which INI-files the running T.C. instance uses, go to Help => About.

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

Post by *HBB »

Karl, thank you very much for your explanations.

Ini location in "Help>About" is as follows : C:\WINDOWS\P:/Files/Programs/TotalCmd/wincmd.ini
I always see it and can not understand how TC resolves it.

You wrote :
You cannot use variables like %COMMANDER_PATH% and %COMMANDER_DRIVE% outside of T.C. They mean nothing to Windows.
I think that I did not use these variables outside of TC. I used them in TC's button definitions. TC should know the meaning of these variables by considering TotalCmd.exe's path and drive. In fact TC resolves them as I expect, because there is no trouble about %COMMANDER_PATH% and %COMMANDER_DRIVE%.

%COMMANDER_INI% is the problem. You wrote :
T.C. will not use the INI-files which you expect.
Since I put the "path\wincmd.ini" as the command line parameter, I hoped that TC should consider it as %COMMANDER_INI%. But not...

When I define "wincmd.ini" as command line parameter, TC considers the contents of "wincmd.ini" but not the path of it... Why? I did not really understand..

Best regards
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50830
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Strange, maybe it's because you are using forward slashes?
Author of Total Commander
https://www.ghisler.com
User avatar
Mikefield
Power Member
Power Member
Posts: 628
Joined: 2006-02-26, 19:13 UTC
Location: Oberursel, Germany HE

Post by *Mikefield »

2HBB. Please open a command prompt (DOS-Window) within Total Commander and run following command: set c
Please report the lines with Commander_ in front.

mf
Bankster - Word of the Year 2009
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

To Mikefield :
You can find Image of "set c"

To Ghisler :
- TC is not installed (there is nothing in Add/Remove Programs)
- TC is executed as portable as follows : P:\Programs\TotalCmd\TOTALCMD.EXE /I=%COMMANDER_DRIVE%/Files/Programs/TotalCmd/wincmd.ini /F=%COMMANDER_DRIVE%/Files/Programs/TotalCmd/wcx_ftp.ini
- In registry ..blabla../Software/Ghisler/Total Commander : InstallDir=P:\Programs\TotalCmd, IniFileName=.\wincmd.ini, FtpIniName=.\wcx_ftp.ini
- There is no wincmd.ini and wcx_ftp.ini in C:\Windows
- %COMMANDER_INI%\..\ returns as C:\Windows in TC's Button.

Edited >>> To Ghisler : You are right!
When I run : P:\Programs\TotalCmd\TOTALCMD.EXE /I=%COMMANDER_DRIVE%\Files\Programs\TotalCmd\wincmd.ini /F=%COMMANDER_DRIVE%\Files\Programs\TotalCmd\wcx_ftp.ini
"%COMMANDER_INI%\..\" returns as "p:\Files\Programs\TotalCmd\"

Interesting...
Post Reply