AlternateUserIni and RedirectSection

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Damel
Member
Member
Posts: 130
Joined: 2003-02-06, 01:11 UTC
Location: Prague, Czech Republic

AlternateUserIni and RedirectSection

Post by *Damel »

Hi Christian,
my Q is about using %USERNAME% variable in AlternateUserIni and RedirectSection settings, e.g.

AlternateUserIni=wincmd_%USERNAME%.ini

RedirectSection=wincmd_%USERNAME%_history.ini

Now or in next v.

Example:
C:\totalcmd\
wincmd.ini (all shared settings)
wincmd_user1.ini (users specified settings)
wincmd_user1_history.ini (users history)
wincmd_user2.ini
wincmd_user2_history.ini
wincmd_user3.ini
wincmd_user3_history.ini

EDIT: Ofc %USERNAME%, thanks MVV :)
Last edited by Damel on 2010-11-30, 23:40 UTC, edited 2 times in total.
The best solution:
1. format C:
2. install TotalCmd
3. install Windows (optionally)
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I think you need variable USERNAME instead of USERPROFILE because the second one contains full path to profile folder so you get buggy string like wincmd_C:\Documents and Settings\User.ini. :wink:
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Both of these work for me:

Code: Select all

[Lister]
RedirectSection=wincmd_%USERNAME%_Lister.ini

Code: Select all

[Lister]
RedirectSection=wincmd_%$USERNAME%_Lister.ini
And it is read properly when fed an alternate user-ini from the command-line parameter.

Code: Select all

@ECHO OFF
SET TC=%ProgramFiles%\TotalCMD
SET TCmd=%TC%\TotalCMD.exe
SET TCDATA=%APPDATA%\_TC_
SET TCTOOL=%wuBIN%\TCTools
SET TCMC=%TCTOOL%\TCMC.exe 50
:: junction -d "%TC%\Data"
:: junction "%TC%\Data" "%TCDATA%"
START "" "%TC%\TotalCMD.exe" /I="%TC%\Data\wincmd\wincmd.ini"
%ProgramFiles%\TotalCMD\Data\wincmd wrote:contplug.ini
ShellDetails.ini
usercmd.ini
wcx_ftp.ini
wincmd.ini
wincmd_Foobar_Lister.ini
wincmd_CustomFields.ini
wincmd_DirMenu.ini
wincmd_History.ini
wincmd_History-LR.ini
wincmd_History-RenameSearch.ini
wincmd_History-Selection.ini
wincmd_InternalAssoc.ini
wincmd_Lister.ini
wincmd_MRT.ini
wincmd_OpenTabs.ini
wincmd_Plugins-Content.ini
wincmd_Plugins-Disabled.ini
wincmd_Plugins-FileSys.ini
wincmd_Plugins-Lister.ini
wincmd_Plugins-Packer.ini
wincmd_Shortcuts.ini
wincmd_StartMenu.ini
wincmd_Templates-Rename.ini
wincmd_Templates-Searches.ini
wincmd.key
tcignore.txt
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Though, I would think it would be much cleaner to keep user-specific settings in the documents & settings folders. Rather than all in one dir with files named by User.

Which is where I have those files, they are just accessible via a junction in TC's program folder.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
Damel
Member
Member
Posts: 130
Joined: 2003-02-06, 01:11 UTC
Location: Prague, Czech Republic

Post by *Damel »

Balderstrom wrote:Both of these work for me:

Code: Select all

[Lister]
RedirectSection=wincmd_%USERNAME%_Lister.ini

Code: Select all

[Lister]
RedirectSection=wincmd_%$USERNAME%_Lister.ini
Yes this is OK, my mistake (USERNAME/USERPROFILE). Thanks
The best solution:
1. format C:
2. install TotalCmd
3. install Windows (optionally)
Post Reply