---
title: "Making an autoexec.cfg That Actually Loads"
excerpt: "Where autoexec.cfg goes, why config.cfg keeps overwriting your settings, how to make an autoexec that wins, and the file-extension and quoting traps that stop it loading at all."
category: "client"
tags: "autoexec, config"
image: ""
read_time: "8 min read"
---
<p>An <code>autoexec.cfg</code> is how you keep your rates, crosshair, binds and net settings in one file the game runs at startup — instead of retyping them or losing them when the game rewrites <code>config.cfg</code>. The trouble is that a naive autoexec often appears to do nothing: the settings load, then <code>config.cfg</code> loads on top and clobbers them, or the file has a hidden <code>.txt</code> extension and never runs. This is how to make one that actually sticks.</p><h2>1. Put it in the right folder</h2><p>The file goes directly in your game's <code>cstrike/</code> directory, next to <code>config.cfg</code>:</p><pre>Steam/steamapps/common/Half-Life/cstrike/autoexec.cfg</pre><p>Not in a subfolder, not in the Half-Life root — in <code>cstrike/</code>. The engine looks for it there at startup and executes it as console commands.</p><h2>2. Write plain console commands</h2><p>Each line is exactly what you would type in the console. Quote multi-word values:</p><pre>// autoexec.cfg
rate 25000
cl_updaterate 101
cl_cmdrate 101
cl_interp 0.01
fps_max 100
hud_fastswitch 1
bind "mouse4" "+voicerecord"
crosshair 1
// a marker so you can prove it ran:
developer 0
echo "autoexec.cfg loaded"</pre><p>The <code>echo</code> line is a deliberate trick: if you see <code>autoexec.cfg loaded</code> in the console at startup, the file ran. If you never see it, the file is not being found — skip to the extension trap below.</p><h2>3. Defeat the config.cfg overwrite</h2><p>Here is the core conflict: the game writes your current settings to <code>config.cfg</code> when you quit, and executes it at startup. If <code>config.cfg</code> loads <em>after</em> your autoexec, it overwrites anything you set. Two reliable fixes:</p><ul><li><strong>Set the value in-game once, then let config.cfg keep it.</strong> For settings the menu supports (crosshair, most video/audio), just set them in Options; they persist in <code>config.cfg</code> and you do not need autoexec for them at all.</li><li><strong>Make config.cfg read-only.</strong> After you have your settings the way you like, set <code>config.cfg</code> to read-only in file properties. The game can no longer overwrite it on quit, so it stops fighting your autoexec. The trade-off: changes you make in the menu no longer save, so do this only once your setup is final.</li></ul><p>For rates and binds — the things the menu does not fully cover — autoexec plus a read-only config is the combination that holds.</p><h2>4. Force it with a launch option</h2><p>To remove all doubt about load order, execute the autoexec explicitly and last via a launch option. Right-click CS in Steam → Properties → Set Launch Options:</p><pre>+exec autoexec.cfg</pre><p>This runs the file at startup regardless of the internal order, and because it is processed as a startup command it lands after the normal config load on most builds. Combined with the read-only trick, your settings win.</p><h2>5. The file-extension and encoding traps</h2><p>The single most common reason an autoexec "does not load" is that it is not actually named <code>autoexec.cfg</code>. Windows hides known extensions by default, so a file you saved as <code>autoexec.cfg</code> in Notepad is really <code>autoexec.cfg.txt</code> — the engine never sees it. Turn on "File name extensions" in Explorer's View menu and confirm the name is exactly <code>autoexec.cfg</code> with no trailing <code>.txt</code>. Save it as plain ANSI/UTF-8 text without a byte-order mark; a stray BOM or curly "smart quotes" from a word processor break the first line. This is the same trap that silently breaks <a href="/tutorials/motd-txt-html-guide">motd.txt</a> on the server side.</p><h2>Common errors</h2><ul><li><strong>No <code>echo</code> message at startup</strong> — the file is misnamed (<code>autoexec.cfg.txt</code>) or in the wrong folder. Fix the extension and location.</li><li><strong>Settings load then reset</strong> — <code>config.cfg</code> overwrote them. Make <code>config.cfg</code> read-only or add <code>+exec autoexec.cfg</code> to launch options.</li><li><strong>One bind ignored</strong> — unquoted multi-word command, or a key name typo. Quote the command and check the key name against <a href="/tutorials/cs16-binds-and-aliases">the binds guide</a>.</li><li><strong>First line errors</strong> — the file has a UTF-8 BOM or smart quotes. Re-save as plain text with straight quotes.</li><li><strong>Changes in the menu no longer save</strong> — you left <code>config.cfg</code> read-only. That is expected; toggle it writable to change menu settings, then set it back.</li></ul><h2>Verification</h2><p>Launch the game, open the console, and look for your <code>echo "autoexec.cfg loaded"</code> line at the top. Then read a value back by typing its name with no argument:</p><pre>cl_updaterate
rate</pre><p>They should show what your autoexec set, not the defaults. Quit and relaunch to confirm they survive a restart — if a value reverts, <code>config.cfg</code> is still overwriting it and you need the read-only or <code>+exec</code> fix. Once it holds, build your keybinds on top with <a href="/tutorials/cs16-binds-and-aliases">binds and aliases</a>.</p>









