Config

How to Create an Autoexec in CS2

Create a CS2 autoexec.cfg in the correct folder, test that it loads at startup and fix filename, path or launch-option problems.

How to create a CS2 autoexec

Open CS2's local files through Steam, enter game\csgo\cfg and create a plain-text file named autoexec.cfg. Add only the commands you want CS2 to apply whenever the game starts.

The file must end in .cfg rather than .cfg.txt. Keep a backup and begin with a few commands so an error is easy to identify.

  1. Open CS2's local files

    In Steam, right-click Counter-Strike 2, choose Manage and Browse local files.

    Steam
    LibraryCounter-Strike 2ManageBrowse local files
    Right-click Counter-Strike 2 in your Steam Library, then choose Manage and Browse local files.
  2. Open game\csgo\cfg

    Open game, then csgo, then cfg. The folder still uses the csgo name in the current CS2 installation.

    Open this folder
    Counter-Strike Global Offensivegamecsgocfg
    The active CS2 path still contains the folder name csgo.
  3. Create autoexec.cfg

    Create a new plain-text file, rename it autoexec.cfg and confirm Windows did not leave a hidden .txt extension.

    ropz-profile.cfgCorrect
    ropz-profile.cfg.txtWrong extension
    Turn on File name extensions in Windows so the complete filename is visible.
  4. Add a small test configuration

    Paste a few supported commands and add an echo line so the console can confirm that the file ran.

  5. Save and test the file

    Start CS2, open the developer console and enter exec autoexec. Check for the confirmation message and any errors.

    CS2 developer console> exec ropz-profile
    Enter exec followed by the filename without the .cfg extension, then press Enter.
Starter autoexec contents
sensitivity 1; cl_radar_always_centered 0; cl_radar_scale 0.4; cl_hud_radar_scale 1; echo BestCrosshair_autoexec_loaded
Test the file
exec autoexec

Where is the CS2 autoexec location?

The reliable route is Steam Library → Counter-Strike 2 → Manage → Browse local files, followed by game\csgo\cfg. Using Steam avoids guessing which drive or library contains the active installation.

Do not place the file only in an old userdata folder or the top-level Counter-Strike folder. Test the exact file in game with exec autoexec before troubleshooting startup behavior.

What should an autoexec contain?

Use it for supported console values and binds you deliberately want to keep. Radar, viewmodel, sensitivity and crosshair commands are common examples. The radar settings guide and viewmodel import guide provide safe command groups you can test separately before adding them.

Avoid outdated performance commands, unknown aliases and files that bind keys without explaining them. One command per line is easiest to review, although semicolon-separated commands also work.

How to check that autoexec.cfg loads

Put an echo command at the bottom of the file, enable the developer console and restart CS2. Open the console and look for the unique confirmation text. You can also query a known value by entering its command name without a new value.

If exec autoexec works manually but the startup confirmation is absent, first recheck the filename and folder. Only then test an explicit Steam launch option.

Confirmation line
echo BestCrosshair_autoexec_loaded
Optional Steam launch option
+exec autoexec.cfg

Do you need +exec autoexec.cfg?

Start without an extra launch option and verify the file normally. If the correct file runs with exec autoexec but is not applied at startup, Steam can explicitly request it with +exec autoexec.cfg under Counter-Strike 2 → Properties → General → Launch Options.

Do not use -autoconfig at the same time. Steam documents that -autoconfig ignores settings inside CFG files until the option is removed.

Fix a CS2 autoexec that does not work

Match the symptom below before rebuilding the file. Most failures are caused by the path, a hidden extension or one invalid command.

Couldn't exec autoexec
Likely cause

CS2 cannot find a readable autoexec.cfg in the active cfg folder.

What to do

Use Browse local files, open game\csgo\cfg and confirm the exact filename and extension.

The file is autoexec.cfg.txt
Likely cause

Windows hid known file extensions while the file was renamed.

What to do

Enable File name extensions in File Explorer and rename the file to autoexec.cfg.

Only some commands apply
Likely cause

One or more commands are outdated, misspelled or restricted.

What to do

Read the console errors and test one command at a time. Remove any line whose purpose you cannot verify.

The settings work manually but not at startup
Likely cause

The startup file is not being executed, or another config later replaces the values.

What to do

Add a unique echo line, inspect other startup files and then test +exec autoexec.cfg as the only related launch option.

Settings reset after troubleshooting
Likely cause

The -autoconfig launch option is still active.

What to do

Remove -autoconfig from Steam Launch Options and restart CS2 normally.

Frequently asked questions

Where do I put autoexec.cfg in CS2?

Use Steam's Browse local files option, then open game\csgo\cfg and place autoexec.cfg there.

Does CS2 need +exec autoexec.cfg?

Test the correctly named file first. If exec autoexec works manually but startup execution does not, add +exec autoexec.cfg in Steam Launch Options.

Why is my autoexec actually a text file?

Windows may hide the .txt extension. Enable File name extensions and make sure the complete filename is autoexec.cfg, not autoexec.cfg.txt.

Can an autoexec include binds?

Yes, but only include binds you understand. Inspect downloaded files because a bind can replace an existing key action.

Sources and further reading

Related CS2 guides

ConfigHow to Install a CS2 Config (CFG)SettingsBest CS2 Radar Settings and CommandsSettingsHow to Import CS2 Viewmodel CommandsCrosshairsHow to Import a CS2 Crosshair Code (Step by Step)