Aliases, environment variables and variable functions can only be
defined or modified by TCC commands ALIAS, SET, and FUNCTION, respectively.
The can be deleted (undefined) by the same commands using an empty string
after the equal sign "=", or more simply by the respecting "UNxxx" commands.
That's one of the fundamental issues with all of your attempts.
All directives (applicable to a specific version of TCMD / TCC) are
always "set", i.e., if the relevant SECTIONs of your .INI file do not assign
values to them explicitly, they receive a DEFAULT value. The primary way to
modify these values is by using the OPTION pull-down menu in TCMD, or the
DIALOG mode of the OPTION command in TCC, which modify, or (if necessary)
create the appropriate SECTION and DIRECTIVE entries in the SAME .INI file
which was used to start the current instance of TCMD or TCC, and are used in
all future invocations of the program that are started without explicit
filespecifation of the .INI file to be used. TCC directives can be modified
for the current instance of TCC only (and inherited by such instances that
are create either by PIPING or by the START command without using an
explicit filespecifiation of the .INI file) using the OPTION command as
described in help topic "option.htm".
Which .INI file the current instance of TCC used is availabe as the
value of the _ININAME internal variable. You can display it using the
command "echo %_ininame". This is the file that the dialog mode of of the
OPTION command would modify. If your TCC instance is running in a TCMD tab,
this .INI file is not necessarily the same as the .INI file which was used
when you started TCMD (e.g. if you used TCMD's OPTION dialog for it to
automatically create a TCC TAB with a command line which specifies a .INI
file). If your TCC tab was started in the default manner, TCMD's OPTION
pull-down menu allows you to modify the TCC options.
The TCC commands [UN]ALIAS, [UN]FUNCION, OPTION and [UN]SET allow you to
manipulate more than one entry at a time, using a file of definitions. The
definition syntax at the command line is different from the syntax in a
definition file. Each line in a definition file specifies a single item, and
is essentially in the format "name=value", and all values are used exactly
as entered (e.g. if the line contains a percent sign % followed by the name
of a variable it is not expanded to be the current value of the variable, it
is just placed in value AS WRITTEN). I believe that SECTION headers are
ignored in directive files loaded by the OPTION command (using OPTION
@file).
To manipulate the .INI file which started the current instance of TCC
your best method is to use the @INIREAD function to determine whether or not
it changes the default, and the @INIWRITE function to modify it for future
TCC instances:
echo Directive ANSI=%@iniread[%_ininame,4NT,ANSI]
echo %@iniwrite[%_ininame,4NT,ANSI,yes]