How to save CS2 console commands in a CFG file

Create a CFG with commands you have checked, load it with exec, and verify the file extension and settings after restarting.

Create a file in the game folder

Open Counter-Strike 2’s installed files from Steam. Go to game\csgo\cfg under that folder. Create mysettings.cfg and check that the file name does not end in .cfg.txt. Add one command per line, for example cl_hud_color 9.

Run the file manually

Enter exec mysettings in the CS2 console. Then enter cl_hud_color without a number and check the value it prints. If exec reports that it cannot find the file, check the folder, name and extension. Test commands individually before putting them into a shared file.

Choose when to apply your settings

Keep a separate mysettings.cfg if you only need the commands for practice or recording. For settings you want at each launch, put the lines you have checked in autoexec.cfg. If you already have one, back it up and add only the lines you need. Check the setting again after restarting. If it changes back, look for another assignment in the files you load.

Questions and answers

Does exec save my console history?

exec runs the commands in the file you name. Add the lines you want to keep to the CFG yourself.

Sources

Find your next skin