For the different ini files here are their variable names:
// Runtime/Core/Private/Misc/CoreGlobals.cpp
FString GEngineIni; /* Engine ini filename */
/** Editor ini file locations - stored per engine version (shared across all projects). Migrated between versions on first run. */
FString GEditorIni; /* Editor ini filename */
FString GEditorKeyBindingsIni; /* Editor Key Bindings ini file */
FString GEditorLayoutIni; /* Editor UI Layout ini filename */
FString GEditorSettingsIni; /* Editor Settings ini filename */
/** Editor per-project ini files - stored per project. */
FString GEditorPerProjectIni; /* Editor User Settings ini filename */
FString GCompatIni;
FString GLightmassIni; /* Lightmass settings ini filename */
FString GScalabilityIni; /* Scalability settings ini filename */
FString GHardwareIni; /* Hardware ini filename */
FString GInputIni; /* Input ini filename */
FString GGameIni; /* Game ini filename */
FString GGameUserSettingsIni; /* User Game Settings ini filename */
This should help you update the ini files. However I found that although it writes to the ini file directly (in my case the EditorPerProjectUserSettings.ini) changes in the editor or closing reverts the changes. It seems like there is a cache that gets saved to disk and using this function changes the values on disk but not the ones in cache. Using Flush didn’t update it in the cache for me. I’m getting the same keys being replaced whether I’m using the snippet above to write to the ini file or using python to do the same.
I’ll update if I can figure out how to properly propagate the values to the config cache for proper saving.