Page 1 of 1

AlternateUserIni and RedirectSection

Posted: 2010-11-30, 22:15 UTC
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 :)

Posted: 2010-11-30, 23:06 UTC
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:

Posted: 2010-12-01, 00:13 UTC
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

Posted: 2010-12-01, 00:27 UTC
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.

Posted: 2010-12-01, 00:49 UTC
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