Tools to help with comparing Wincmd.ini files,
the configuration files for Total Commander (TC)
For a quick start:
1. Read sections E1, E4, and F below.
2. Unzip the EXE file to the directory for a Wincmd.ini file.
3. Double-click on the EXE file.
4. Click on the appropriate button.
5. Select an input file and an output file. Reformatting should take only a second.
The original and most fully-formatted Readme file is Readme.sxw (created in Open Office), from which Readme.rtf, Readme.txt, and Readme.html are created. TC can display Readme.rtf.
The problem: it may not be practical to compare different Wincmd.ini files without some reformatting.
Keyword sections may be in different orders in different Wincmd.ini files.
Commands within a given keyword section may be in different orders in different Wincmd.ini files.
A leading semicolon (";") can be used to turn a line into a comment. It also is possible to add blank lines, for example before a keyword or command to make it more noticeable. If keywords and commands are sorted, comments and blank lines could end up in the wrong locations.
Commands in the menu sections might not be grouped by item number, for example if the lines were sorted, which makes it less convenient to add, move, or remove whole menu items.
Commands in the directory hotlist and start menu sections contain item numbers. Adding or removing an item causes TC to renumber the following items automatically, making comparison of the rest of the section difficult. (The commands for a particular item have the same item number.)
Problems not addressed:
These tools do not perform file comparisons.
These tools do not provide an environment for manual editing of files. Comparison and side-by-side editing are possible in various file comparison software packages. A couple of packages are mentioned at http://www.ghisler.com/tools.htm
When might you need to use these tools?
Across computers: You may want to synchronize part or all of the TC configurations on different computers, when each configuration might have some item that you would want to know about, or that should be used on both computers.
Across time: You may want to see how your configuration has changed with time, and with new versions of Total Commander.
Sorting within: You may want to read the sorted commands in a Wincmd.ini file, without any automated comparison.
What do these tools do?
The first tool, NumToSep (the top button when the program is run), solves problems A1-A5 above.
NumToSep sorts the keyword sections.
It sorts commands within each keyword section.
It keeps comments and blank lines above the following keyword or command. (If your text editor placed a "last change date" stamp beginning with ";" at the top of the file, that line will be sorted also.)
It sorts within menu sections, by item number and then by type of command.
It removes item numbers from the directory hotlist and start menu sections, and inserts blank lines between items.
The second tool, SepToNum (the second button from the top when the program is run), restores the Ini file format, allowing Total Commander to use the revised Wincmd.ini file.
SepToNum adds item numbers to the directory hotlist and start menu sections.
SepToNum removes the blank lines added by NumToSep.
File management:
It is wise to back up your original Wincmd.ini files, whether or not you use these tools. It is possible to make a mistake while synchronizing, for example to accidentally add or remove a blank separator line.
You may be working with multiple files for each original Wincmd.ini file:
The original Wincmd.ini file.
The sorted and separated file created by NumToSep (D1 above). If you synchronize files, you might save the synchronized version of a file to a new name. However, for simplicity, the default input filename for SepToNum (D2 above) is unchanged from the output filename for NumToSep.
The file with restored Ini format, output from SepToNum. It is possible to use the original Wincmd.ini file name here, thereby overwriting the original Wincmd.ini (which you backed up, yes?). I prefer to use Total Commander to do any overwriting of the original.
You will be working with at least two original Wincmd.ini files.
How to avoid getting lost with various files and file names?
Use a separate directory (folder) for each original Wincmd.ini file. If practical, I leave the file in the directory where I found it.
Put a copy of Wincmd.ini_NumSep.Exe in each original Wincmd.ini file directory. To work with a given original Wincmd.ini file and its related files (E2a-E2c above), run the Exe file that is in the same directory. In case you have more than one Wincmd.ini_NumSep.Exe file running at the same time, you can look at the top of the main box to see that Exe file's directory.
Each Exe file provides initial default file names, and paths corresponding to the Exe file's directory; if you use them, you can save some effort and possible confusion. If you modify the initial default paths and file names (file ID's), the Exe file will save the modified default ID's in the file Wincmd.ini_NumSep.cfg.
If you are ready to replace an original Wincmd.ini file, consider using Total Commander so that you can see more context for what you are doing.
Miscellaneous: disclaimer, etc.
There is no warranty.
The program only writes to three output files:
the output file from NumToSep (E2b above),
the output file from SepToNum (E2c above), and
the configuration file containing default file ID's (E4c above).
Please mention any problem on the Total Commander forum, in particular http://www.ghisler.ch/board/viewtopic.php?t=5714#5714
The main Total Commander site is at http://www.ghisler.com
You may modify the source and Exe files, if you use a different Exe file name to avoid confusion.