sync settings across different machines

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
robertmarkbram
Junior Member
Junior Member
Posts: 10
Joined: 2009-07-31, 02:15 UTC

sync settings across different machines

Post by *robertmarkbram »

Hi All,

I run Total Commander on my home and work machine, and often I make a settings change that I want available on both.

However, I notice that the ini file contains things like history etc that includes drive letters and things that otherwise are not portable.

Is there an easy way to transport just the config options - without things that would be machine dependent?

Thanks for any advice!

Rob
:)
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

TC HELP: Ini File Settings
RedirectSection=
See description of AlternateUserIni. Note: When placed in the [Configuration] section, all variables of this section will be redirected, except for AlternateUserIni and UseIniInProgramDir, which will always be read from the main ini file.
AlternateUserIni=
<somename.ini> If present, it will redirect storing of all user-changeable sections to an alternate ini file (in this example, somename.ini), except for the following sections: [Configuration], [Layout], [Packer], [Confirmation], [Extensions], [Shortcuts], [PackerPlugins], [FileSystemPlugins], [ListerPlugins], [ContentPlugins]. These sections can be redirected individually, though:
In each section, an entry RedirectSection= can be added to change the default behaviour. It will allow to redirect (or not) this section to another ini file: Possible values:

0: no redirect
1: redirect to ini file defined via AlternateUserIni=<alternate ini file.ini>
<ininame.ini>: redirect to that specific ini
What that jazz means, basically, each section (like History) that contains non-portable paths can be redirected to alternate files, so that what would remain in the wincmd.ini would be just the settings you wish to be there.
IIRC you can direct multiple sections to the same file.

Note, as I read in this thread: redirect [Configuration] section, the information in the HELP in regards to what can/cannot be redirected is outdated. From what I gather, ALL INI file sections can be redirected.
User avatar
robertmarkbram
Junior Member
Junior Member
Posts: 10
Joined: 2009-07-31, 02:15 UTC

Post by *robertmarkbram »

Thanks Balderstrom,

A couple of clarifactions if I may..

I put the AlternateUserIni line in wincmd.ini:

Code: Select all

[Configuration]
AlternateUserIni=RobsTotalCmdConfig.ini
And I see RobsTotalCmdConfig.ini now.. but, for example, I edited ALT+D hokey to map to cm_EditPath..

Code: Select all

A+D=cm_EditPath
but that is showing in wincmd.ini, not RobsTotalCmdConfig.ini

And it looks like both files are storing absolute paths (that won't work on both my machines)..

RobsTotalCmdConfig.ini:

Code: Select all

[left]
path=c:\rob\apps\totalcmd\robsIni\
wincmd.ini:

Code: Select all

[Configuration]
AlternateUserIni=RobsTotalCmdConfig.ini
InstallDir=C:\rob\apps\totalcmd
Did I misunderstand? I do that a lot.. :(
Not sure if/how I can use this feature to transport settings between machines.

Rob
:)
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

In your case I wouldn't use it for the "[Configuration]" section of wincmd.ini

I'd take a perusal through your wincmd.ini look for sections that contain absolute paths. Like History or such and RedirectSection=TCUsage.ini (or such)

I don't really use Redirect options, though I may to keep it clean of usage info, like opened tabs, history, searches, etc... Things that would keep the the wincmd.ini cleaner.

Personally, what I do, is just do a search/replace in my files periodically.

Edit: wincmd.ini
Search: C:\User\Foo\Application Data\GHISLER\
Replace: %APPDATA%\GHISLER\

When I install, I select the option that saves the INI to ApplicationData instead of System32 or ProgramInstall Folder.

Sometimes things also get set to one of the junctions I have:
C:\Programs\TotalCMD\Data --> C:\User\Foo\Application Data\GHISLER
So I'll
Search: C:\Programs\TotalCMD\Data
Replace: %APPDATA%\GHISLER

Save out the INI, and except for maybe some history et al, everything is pointing to the right place.

Since no matter what USER or Machine YOU use, just make sure they all have a GHISLER, or TotalCMD folder, i.e.
\Documents and Settings\YOURNAME\Application Data\GHISLER OR
\Documents and Settings\YOURNAME\Application Data\TotalCMD (etc)
Then a quick edit of the wincmd.ini and its usable pretty much anywhere.

Keep your Plugins in a directory like:
\Documents and Settings\YOURNAME\Application Data\GHISLER\Plugins\
etc, in my case that's
C:\Users\FOO\Application Data\GHISLER\Plugins

Toolbars, Menus, etc... all subdirs of GHISLER


NOTE: Junctions are another way to keep everything pointing to the right place. If you put your wincmd.ini in C:\Programs\TotalCMD\Data\wincmd.ini
Where "Data" is just a junction to:
--> C:\User\AtHOME1\Application Data\GHISLER
And on your other machine, C:\Programs\TotalCMD\Data is a junction to:
--> C:\User\AtWORK1\Application Data\GHISLER

Now pretty much in your wincmd.ini can point thru to C:\Programs\TotalCMD\Data ... and so long as you keep your plugins/etc sync'd on both machines, your wincmd.ini will reference the same things on both machines.

This latter part, junctioning thru to the AppData folder, only really works if you are the only user on the machine. Which in my case I am, but I have a few different logins, thus to keep things neat, I prefer the former, and just keep the wincmd.ini referencing %APPDATA% for the most part.
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

%APPDATA%\GHISLER\
Just an alternative:
%COMMANDER_INI%\..\
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Using %APPDATA% or the %COMMANDER_INI% as Lefteous points out can be used pretty much everywhere.

For example, in my ButtonBar, the PaperClip ICON:
Command: %APPDATA%\GHISLER\GUI\TCMenu.exe
Parameters: %%APPDATA%%\GHISLER\GUI\ToolBars\cutCopyPaste†††.bar
Start Path:
Icon File: %APPDATA%\GHISLER\GUI\icons\CCPX.icl
Icon: 5
Tooltip: Cut Copy Paste
And the actual cutCopyPaste†††.bar file
[Buttonbar]
Buttoncount=3
button1=%AppData%\GHISLER\GUI\icons\CCPX.icl,4
cmd1=cm_CutToClipboard
iconic1=0
menu1=^X Cu&T
button2=%AppData%\GHISLER\GUI\icons\CCPX.icl,7
cmd2=cm_CopyToClipboard
iconic2=0
menu2=^C &Copy
button3=%AppData%\GHISLER\GUI\icons\CCPX.icl,21
cmd3=cm_PasteFromClipboard
iconic3=0
menu3=^V &Paste
elbordo
Junior Member
Junior Member
Posts: 2
Joined: 2025-02-18, 16:04 UTC

Re: sync settings across different machines

Post by *elbordo »

Amazing, as before searching for "sync sections of ini files" and finding this post, I've gone creating a script to sync INI files, as I'm now running two TC instances, one with regular fonts, and another with large fonts and a different layout. So I needed to keep the dir menu and the start menu in sync.
Here's my script if it can help https://github.com/Threepwood-7/ini-sections-copier
Post Reply