How to Create an Autoexec CFG in CS2: A Complete Setup Guide
If you've played Counter-Strike for any length of time, you've probably heard the term autoexec thrown around. In CS2, it remains one of the most powerful tools available to players who want to lock in their settings, automate commands, and ensure their configuration loads exactly the same way every single session.
What Is an Autoexec File in CS2?
An autoexec.cfg is a plain-text configuration file that CS2 reads and executes automatically every time the game launches. Think of it as a personal instruction sheet you hand to the game before it starts — telling it exactly how you want your crosshair, sensitivity, rates, binds, and other settings configured.
Without an autoexec, some settings may reset between sessions or get overwritten by game updates. With one, your setup is persistent, portable, and fully under your control.
Where CS2 Stores Configuration Files
CS2 uses a specific folder path for config files. On a standard Windows installation, you'll find it here:
C:Program Files (x86)SteamsteamappscommonCounter-Strike Global Offensivegamecsgocfg 📁 The folder is labeled
csgofor legacy reasons, but this is the correct directory for CS2 configs.
On macOS or Linux, the path follows the same Steam library structure but under your home directory's Steam installation folder.
How to Create the Autoexec File Step by Step
Step 1: Navigate to the CFG Folder
Open File Explorer and follow the path above. If you've changed your Steam library location, adjust the drive letter or path accordingly.
Step 2: Create a New Text File
Right-click inside the cfg folder, select New > Text Document, and name it exactly:
autoexec.cfg Make sure the file extension is .cfg and not.cfg.txt. This is the most common mistake. In Windows, you may need to enable "Show file name extensions" in File Explorer's View settings to confirm this.
Step 3: Open and Edit the File
Open the file with any plain-text editor — Notepad works perfectly. You can also use Notepad++ or VS Code for syntax highlighting, though it's not required.
Inside the file, you write console commands — one per line. These are the same commands you'd type into the in-game developer console.
Step 4: Add Your Commands
Here's a basic example of what an autoexec might contain:
// Sensitivity & Mouse sensitivity 1.2 m_rawinput 1 // Network rates rate 786432 cl_cmdrate 128 cl_updaterate 128 // Crosshair cl_crosshairsize 2 cl_crosshairthickness 0.5 cl_crosshairdot 0 cl_crosshaircolor 4 // Audio volume 0.5 snd_musicvolume 0 // Misc fps_max 300 con_enable 1 // Force execute host_writeconfig Lines beginning with // are comments — they're ignored by the game and exist purely for your own notes.
Step 5: Force the Game to Load It
CS2 should detect and run the autoexec automatically on launch, but to guarantee it, add a launch option in Steam:
- Right-click Counter-Strike 2 in your Steam library
- Select Properties
- In the Launch Options field, add:
+exec autoexec.cfg
This explicitly tells CS2 to execute your file at startup, removing any ambiguity.
Key Variables That Affect How Your Autoexec Behaves
Not every autoexec works identically for every player. Several factors shape what you can and should include:
| Variable | Why It Matters |
|---|---|
| Hardware specs | Commands like fps_max should match what your system can actually sustain |
| Monitor refresh rate | Affects whether frame cap settings are meaningful |
| Network connection | Rate commands are most impactful on stable, higher-bandwidth connections |
| Playstyle | Binds, crosshair preferences, and HUD settings are highly personal |
| Competitive vs. casual | Some settings matter far more at higher tick rates or in ranked play |
Common Commands and What They Do
🎮 A few categories worth understanding before you start copying commands blindly:
- Network rate commands (
rate,cl_updaterate,cl_cmdrate) — control how frequently your client communicates with the server. Values have effective caps tied to server tick rates. - Mouse commands (
sensitivity,m_rawinput,zoom_sensitivity_ratio_mouse) — define how your mouse input translates to in-game movement. - Crosshair commands — CS2 has a robust crosshair system. These settings are among the most personal in any config.
- Alias commands — advanced users create aliases to bind multiple commands to a single key, such as a jump-throw bind for grenades.
- host_writeconfig — tells CS2 to write your current config to disk, helping settings persist across updates.
The Spectrum of Autoexec Complexity
Autoexec files range from a dozen lines covering just crosshair and sensitivity, to hundreds of lines with nested aliases, per-weapon configs, and practice server scripts. Neither extreme is inherently better — it depends entirely on what you want to lock down and automate.
Casual players often keep it simple: sensitivity, a preferred crosshair, and maybe a volume setting. 🖱️ Competitive players tend to add network optimization, buy binds, and grenade practice commands for offline use.
Some players maintain separate configs — a practice config, a competitive config, a warmup config — and use the autoexec to call whichever one applies.
A Note on CS2 Updates and Config Behavior
Valve periodically updates CS2 in ways that can affect which console commands remain functional, get deprecated, or change behavior. Commands inherited from CS:GO don't always work identically in CS2. Before building out a large config, it's worth verifying that specific commands are still active in the current build — community resources like the CS2 developer wiki and community forums tend to track these changes quickly.
Your autoexec is only as reliable as the commands inside it. A command that silently fails doesn't break the game, but it does mean part of your config isn't actually doing what you think it is — and that gap between your intentions and your actual setup is often where performance inconsistencies hide.