host_writeconfig Command Help & Examples
Have you ever noticed that every time you start CS:GO, as well as CS2, many of your settings (adjusted with commands) have reset to their default values. This can get annoying after you adjust the settings for the 100th time, so is there a way to save these settings?
Yes! There is indeed a command that can help you with this. Let’s see what it does and how to use it!
Host_writeconfig Command
The command below can be used to save all of your game settings, including those you’ve adjusted with commands, and save them into one .cfg file.
host_writeconfig
To use it start CS2, adjust your in-game settings to your preferences, open the console, and paste the command. This will create new .cfg files in the following directory:
C:\Program Files (x86)\Steam\userdata\[ID Number]\730\local\cfg
Note that every user has a different ID number is different.
Your newly created files should be cs2_machine_convars.vcfg, cs2_user_convars_0_slot0.vcfg, and cs2_user_keys_0_slot0.vcfg and you can open them with Wordpad or Notepad.
You can then use the data from these files to create your own config exec. For example, if you want your custom crosshair settings applied every time you run CS2, you can open the cs2_user_convars_0_slot0.vcfgfile, find the appropriate crosshair commands, and copy them.
Now, create a new .cfg file and name it (e.g. config.cfg), open it and paste all those crosshairs commands you copied, and then put this file into the following directory:
C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo\cfg
Now, every time you start the game you can type exec config.cfg into the console and all of your commands/settings will be automatically applied, if they ever reset again.
You can also automate this process by adding an automatic execution of your .cfg. You can do this by going into Steam-Library, right-clicking Counter-Strike 2, selecting Properties, and then typing +exec config.cfg into the launch options.