# How to get Filename of the config ini if I use custom UCLASS specifier 'config'?

**URL:** <https://forums.unrealengine.com/t/how-to-get-filename-of-the-config-ini-if-i-use-custom-uclass-specifier-config/1522381>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, CPP, question\
**Created:** [December 13, 2023, 2:01pm UTC](https://forums.unrealengine.com/t/how-to-get-filename-of-the-config-ini-if-i-use-custom-uclass-specifier-config/1522381 "2023-12-13T14:01:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CyFio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CyFio](https://forums.unrealengine.com/u/CyFio)\
**Post date:** [December 13, 2023, 2:01pm UTC](https://forums.unrealengine.com/t/how-to-get-filename-of-the-config-ini-if-i-use-custom-uclass-specifier-config/1522381/1 "2023-12-13T14:01:39Z")

</div>

Hi, I am creating custom project settings following [How to add custom settings in Project Settings? - Programming & Scripting / C++ - Epic Developer Community Forums (unrealengine.com)](https://forums.unrealengine.com/t/how-to-add-custom-settings-in-project-settings/146330/3)

I want to access the value of those settings from reading ini configs so I followed [How get Project Settings values? - Development / Programming & Scripting - Epic Developer Community Forums (unrealengine.com)](https://forums.unrealengine.com/t/how-get-project-settings-values/307768/4). However, I run into problem with the function

```c++
GConfig->GetString( const TCHAR* Section, const TCHAR* Key, FString& Value, const FString& Filename );

// sample usage, where GGameIni is a built-in variable that stores the path to Game.ini
FString AppVersion;
GConfig->GetString(
	TEXT("/Script/EngineSettings.GeneralProjectSettings"),
	TEXT("ProjectVersion"),
	AppVersion,
	GGameIni
);

```

When used with built-in project settings, it works fine, as the ‘Filename’ param can get auto determined(like GGameIni for ‘Config/DefaultGame.ini’). However, I dont know how to get the ‘Filename’ param if I declared a custom configName in UCLASS() specifier.

For example:

```c++
UCLASS(config = MySetting)
class TESTPLUGIN_API UTestPlugin_Settings : public UObject
{
	GENERATED_BODY()

public:
...
}

```

it stores configs in DefaultMySettings.ini, which cannot get from a built-in variable like GGameIni.

Does anyone know how to determine the Filename param for that function?

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [December 13, 2023, 3:07pm UTC](https://forums.unrealengine.com/t/how-to-get-filename-of-the-config-ini-if-i-use-custom-uclass-specifier-config/1522381/2 "2023-12-13T15:07:34Z")

</div>

GetClass()-\>GetConfigName()  
or  
UTestPlugin\_Settings::StaticConfigName()

---

<div class="post-metadata">

**Author:** ![CyFio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CyFio](https://forums.unrealengine.com/u/CyFio)\
**Post date:** [December 18, 2023, 8:33am UTC](https://forums.unrealengine.com/t/how-to-get-filename-of-the-config-ini-if-i-use-custom-uclass-specifier-config/1522381/3 "2023-12-18T08:33:23Z")

</div>

When I use built-in name(e.g. ‘Game’), it can find that value. However, GConfig-\>GetString() returns false when I use a custom filename like ‘MySetting’. I tried GConfig-\>IsKnownConfigName(‘MySetting’), and it says no.
