Registry path to wincmd.ini

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
piranha
Junior Member
Junior Member
Posts: 70
Joined: 2003-02-07, 19:55 UTC
Location: Miami, Fl
Contact:

Registry path to wincmd.ini

Post by *piranha »

Hi there,

On the old forum there was listing of registry keys and their search order
to obtain the location of tc installation dir and location of wincmd.ini.
Bad luck it does not exist anymore. Does anyone have copy of that information saved somewhere?

On my computer I have only
HKCU\Software\Ghisler\Total Commander InstallDir
value.

Best regards
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

Search in this order, the 1st key that exist should be used:
1. HKCU\Software\Ghisler\Total Commander
2. HKLM\Software\Ghisler\Total Commander
3. HKCU\Software\Ghisler\Windows Commander
4. HKLM\Software\Ghisler\Windows Commander

Under each key there should be three values:
1. "InstallDir" - Path where TC/WC is installed
2. "IniFileName" - Relative* path to the "WinCmd.ini"
3. "FtpIniName" - Relative* path to the "wcx_ftp.ini"

* - Relative to the dir where TotalCmd is installed: "InstallDir"
Last edited by Aezay on 2003-02-24, 19:30 UTC, edited 1 time in total.
Of all the planets I've been to, this one is my favorite.
User avatar
piranha
Junior Member
Junior Member
Posts: 70
Joined: 2003-02-07, 19:55 UTC
Location: Miami, Fl
Contact:

Post by *piranha »

Thanks a lot for quick answer.
Is there info about name of TC executable?
Since this name change things get more complicated :(
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

If "TOTALCMD.EXE" exist, use that one, else expect "WINCMD.EXE".
If that one doesn't exist either, something must be really wrong!
Of all the planets I've been to, this one is my favorite.
User avatar
piranha
Junior Member
Junior Member
Posts: 70
Joined: 2003-02-07, 19:55 UTC
Location: Miami, Fl
Contact:

Post by *piranha »

Aezay wrote: Under each key there should be three values:
1. "InstallDir" - Path where TC/WC is installed
2. "IniFileName" - Relative* path to the "WinCmd.ini"
3. "FtpIniName" - Relative* path to the "wcx_ftp.ini"

* - Relative to the dir where TotalCmd is installed: "InstallDir"
sorry to bug you again, but for some reason I'm missing all those keys. (Well, I have "installdir" only)

You said inifilename and ftpininame are relative..
What in case if installdir = c:\program files\tc and your wincmd.ini is in c:\windows ?
IniFileName contains full path then?
I also know that WinCmd.ini and wcx_ftp.ini can be in 2 different places. Will the keys contain full path?
sorry to ask for all those details, I'm creating a small tool that will help plugin devs, therefore I have to have "all bases covered" :lol:
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

piranha> sorry to bug you again, but for some reason I'm missing all those keys. (Well, I have "installdir" only)
I guess when "IniFileName" or "FtpIniName" is missing, you'll properly find them in %windir%, usually "C:\Windows".

piranha> What in case if installdir = c:\program files\tc and your wincmd.ini is in c:\windows ? IniFileName contains full path then?
I based my assumption on my reg settings. I have my ini files in the install dir, and my "IniFileName"=".\WinCmd.ini" and my "FtpIniName"=".\wcx_ftp.ini". Guess they aren't releative after all, but if the 1st two chars are ".\" you'll have to look in the "InstallDir".
Of all the planets I've been to, this one is my favorite.
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

IniFileName and FtpIniName can be either absolute or relative. TC creates absolute paths. If you didn't specify INI files location during installation these registry keys can be missing.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

IniFileName can also be "wincmd.ini" in which case it is in the windows dir (as strange as it might sound).

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
piranha
Junior Member
Junior Member
Posts: 70
Joined: 2003-02-07, 19:55 UTC
Location: Miami, Fl
Contact:

Post by *piranha »

Hacker wrote:IniFileName can also be "wincmd.ini" in which case it is in the windows dir (as strange as it might sound).

HTH
Roman
To sum it up...
I used following algorithm:
Check the registry in following order:
HKCU "Software\Ghisler\Total Commander" "IniFileName"
HKCU "Software\Ghisler\Total Commander" "IniFileName"
HKLM "Software\Ghisler\Total Commander" "IniFileName"
HKCU "Software\Ghisler\Windows Commander" "IniFileName"
HKLM "Software\Ghisler\Windows Commander" "IniFileName"

Then depending on value:
1. "wincmd.ini" or empty: we should use "$WINDIR\$0" (windows dir/valuename)
2. if two first chars are ".": use "$INSTDIR\$1" (tc installdir\ value without .\)
3. If value begins with "%USERPROFILE%" - it's not clear to me.
This is pretty strange since this dir is nowhere defined within windows.
When I checked how inireloc tool worked, in this case it was putting the files to: "c:\Documents and Settings\robert" and not even in "c:\Documents and Settings\robert\Local Settings\Application Data" as recommended from M$. I guess we need authors clarification here. AFAIK nothing should be put in "c:\Documents and Settings\robert"
In this case I simply display "unsupported" message.

4. Any other value use path from value
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

3. If value begins with "%USERPROFILE%" - it's not clear to me.
This is pretty strange since this dir is nowhere defined within windows.
Open a DOS box and send the command
set

This will show all environment variables. One of them is USERPROFILE.
Author of Total Commander
https://www.ghisler.com
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

piranha wrote:not even in "c:\Documents and Settings\robert\Local Settings\Application Data" as recommended from M$
The path "c:\Documents and Settings\robert" results of the environment variable USERPROFILE which is available at every OS of M$

The path "c:\Documents and Settings\robert\Local Settings\Application Data" results of the environment variable APPDATA which is available for Win2k/XP only.

To have the full compatability USERPROFILE is chosen.
#5767 Personal license
User avatar
piranha
Junior Member
Junior Member
Posts: 70
Joined: 2003-02-07, 19:55 UTC
Location: Miami, Fl
Contact:

Post by *piranha »

ghisler(Author) wrote:
3. If value begins with "%USERPROFILE%" - it's not clear to me.
This is pretty strange since this dir is nowhere defined within windows.
Open a DOS box and send the command
set

This will show all environment variables. One of them is USERPROFILE.
Wow. And I spent like an hour digging thru registry. Didn't think about enviroment variable. shame me! :shock:
Post Reply