How to read write keys into a ".ini" type of file.
Below is some code of how you could do it in plain Gui4Cli - just for reference..

This is best done with a little programming.. Handling any type of text file is easier if you load it into a listview, do the changes, then save it back. Below is some code that will allow you to add or replace keys in .ini files. You could call it with something like:

- gosub #this AddIniKey ":file.ini" "[mySection]" Key Value

xListview 0 0 0 0 '' '' var
  attr ID lv

xRoutine AddIniKey IniPath SectionName Key Value
  // load the ini file into the above listview
  use lv #this lv
  lv load $IniPath
  // do the changes..
  gosub #this AddKey $SectionName $Key $Value
  // re-save it..
  lv save $IniPath

// Below is the routine that does the actual work.
// You could call it repeatedly for many entries..

xRoutine AddKey SectionName Key Value
  local string/k/v/pos

  // find the section
  lvsearch $SectionName first

  // if section not found, append new one..
  if $$lv.valid = 0
    lv add $SectionName
    lv add '$Key=$Value'
    return // finished..
  endif

  // go through the next records to find if the
  // given key exists in this section..
  lv go next
  while $$lv.valid = 1

    // if we encounter another section, insert
    // a new line before it (ie in previous section)

    if $$lv.text[0][1] = '['
      lv insert '$Key=$Value'
      return // finished..
    endif

    // split the line into key and value
    string = $$lv.text
    searchvar string "=" first
    if $$search.pos > ''
      k = $string[0][$$search.pos]
      extract k clean // trim spaces..
      // if we found the key, set it..
      if $k = $key
       
// %rec means the 1st lv column..
        %rec = '$Key=$Value'
        return // finished..
      endif
    endif
 

    lv go next // next line..
  endwhile

  // if we reach here, append to end of list..
  lv add '$Key=$Value'