Config Architecture

How to Create & Run autoexec.cfg in CS2 (Without File Path Errors)

Nine out of ten "autoexec not working" bugs in CS2 come down to three traps: the wrong Source 1 folder, Windows hiding .txt extensions, or Steam Cloud overrides.

CS2 Source 2 Verified Updated November 26, 2026 By Danilo "Kestrel" Reyes 8 min read

Trap #1: The CS2 Directory Changed From CS:GO

Valve kept the outer Steam folder named Counter-Strike Global Offensive so players would not lose library links during the CS2 upgrade — which tricks thousands of people into pasting configs into the old CS:GO subfolder. Source 2 reads exclusively from the nested game\csgo\cfg\ directory:

Steam/steamapps/common/Counter-Strike Global Offensive/ csgo/cfg/autoexec.cfg ← OLD CS:GO PATH (IGNORED BY CS2!) game/csgo/cfg/autoexec.cfg ← CORRECT CS2 SOURCE 2 PATH
If you installed CS2 on a secondary drive (like D:\SteamLibrary\), use Steam → Manage → Browse local files to jump straight to the right root.

Step-by-Step Setup (Zero Mistakes)

  1. Open Steam, right-click Counter-Strike 2 → Manage → Browse local files.
  2. Double-click into game → csgo → cfg. (You should see Valve's built-in files like gamemode_competitive.cfg inside — if you do not, you are in the wrong folder.)
  3. Critical Windows Step: In File Explorer, open View → Show → File name extensions (Windows 11) or check File name extensions on the View ribbon (Windows 10). Without this checked, renaming a Notepad file to autoexec.cfg silently creates autoexec.cfg.txt, which CS2 will never read!
  4. Create a plain text file named autoexec.cfg (or click Download .cfg in our Autoexec Builder and drop it directly into this folder).
  5. Always place these two lines at the very bottom of the file so CS2 saves your settings and prints a bright confirmation message in console:
    Mandatory Footer for Verification
    // Bottom of autoexec.cfg
    host_writeconfig
    echo "========================================"
    echo ">>> CSGOCodex autoexec.cfg LOADED OK <<<"
    echo "========================================"
  6. In Steam, right-click Counter-Strike 2 → Properties → General → Launch Options and add:
    Force CS2 to Load autoexec.cfg Every Boot
    +exec autoexec

Complete Troubleshooting Matrix (Every Error & Exact Fix)

Symptom / Console OutputRoot CauseExact Fix
exec: couldn't exec 'autoexec.cfg' File is named autoexec.cfg.txt or saved in old csgo\cfg\. Turn on Windows file extensions, remove trailing .txt, and confirm path includes \game\csgo\cfg\.
exec autoexec works manually, but never runs on startup Missing +exec autoexec in Steam Launch Options, or file saved with UTF-8 BOM header. Add +exec autoexec to Launch Options; open file in Notepad++ / VS Code and save as plain UTF-8 (no BOM).
Crosshair or sensitivity reverts after restart Steam Cloud / read-only cs2_user_convars_0_slot0.vcfg conflict, or missing host_writeconfig. Remove Read-Only flag on userdata .vcfg files and ensure host_writeconfig sits at the very end of autoexec.cfg.
Console prints 15+ Unknown command errors Copied a legacy CS:GO config containing removed cvars (net_graph, cl_bob, r_cleardecals). Audit and strip dead cvars using our CS:GO → CS2 Replaced Commands Matrix.

Organizing Multiple Config Files Like a Pro

Once your game\csgo\cfg\ folder is working, keep your setup modular instead of jamming offline cheat commands into your main autoexec:

  • autoexec.cfg — Competitive match baseline (runs automatically via +exec autoexec).
  • prac.cfg — Offline utility & smoke lab (grab our complete prac.cfg; run manually via exec prac).
  • demo.cfg — Fast replay scrubbing binds (grab demo.cfg; run via exec demo).

Whenever you finish a practice or demo session, simply type exec autoexec in console before queuing Premier to restore every competitive keybind cleanly.

Frequently Asked Questions

Where is the CS2 cfg folder on Linux / SteamOS (Steam Deck)?

On Linux, the default path is ~/.local/share/Steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/cfg/. Note that Linux filenames are case-sensitive — always use lowercase autoexec.cfg.

Should I set autoexec.cfg to Read-Only in Windows Properties?

There is no need — CS2 never writes back into autoexec.cfg. Leaving it writable makes editing convenient. Only make sure your userdata .vcfg files are not Read-Only so host_writeconfig works cleanly.

Why do comments start with // in CS2 cfg files?

Source 2 ignores anything after // on a line, letting you organize your autoexec into labeled sections (Crosshair, Radar, Binds, Telemetry) without affecting execution.

How do I back up my existing CS2 settings before installing a new autoexec?

Copy your entire Steam\userdata\<SteamID3>\730\local\cfg\ folder to your Desktop or cloud drive before making changes.

Danilo "Kestrel" Reyes · Lead CS2 Config Maintainer & Former Amateur IGL

Long-time Counter-Strike player (3,800+ hours across CS:GO and CS2) maintaining live-tested Source 2 console references, crosshair scaling experiments, and Valve-compliant autoexec templates. Editorial & testing process →