How to Use Autoexec in CS2
A complete guide to setting up and using an autoexec.cfg file in Counter-Strike 2. An autoexec file lets you save your preferred settings so they load automatically every time you start the game.
What is Autoexec.cfg?
The autoexec.cfg file is a plain text configuration file that CS2 reads when it starts up. Every line in the file is treated as a console command and executed automatically. This means any setting you put in your autoexec will be applied every time you launch the game, without needing to manually type commands each session.
This is especially useful for settings that reset between sessions, custom key binds, network optimization, and audio preferences that you want to keep consistent.
Step 1: Find the Config Folder
Navigate to your CS2 configuration folder. The default path depends on your operating system and Steam installation location. The typical path is:
On macOS, look in ~/Library/Application Support/Steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/cfg/. On Linux, check ~/.steam/steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/cfg/.
Step 2: Create the File
Create a new text file in the cfg folder and name it exactly autoexec.cfg. Make sure your operating system is not hiding file extensions - the file must end in .cfg, not .cfg.txt. You can use any text editor like Notepad, VS Code, or Sublime Text.
Step 3: Add Your Commands
Add one console command per line. Lines starting with // are comments and will be ignored. Here is a basic example structure:
The echo line at the end prints a message in the console to confirm your autoexec loaded properly.
Step 4: Ensure It Loads
CS2 should load autoexec.cfg automatically. If it does not, add the following to your Steam launch options:
You can also type exec autoexec in the CS2 console at any time to manually reload the file.
Common Commands for Autoexec
Here are the most popular commands organized by category. Use our Autoexec Generator to build a complete file with all the settings you need.
Network Optimization
| Command | Description |
|---|---|
| rate 786432 | Maximum network bandwidth |
| cl_interp_ratio 1 | Minimum interpolation for less delay |
| cl_interp 0 | Let engine calculate interpolation |
Performance
| Command | Description |
|---|---|
| fps_max 0 | Remove FPS cap |
| r_dynamic 0 | Disable dynamic lighting |
| cl_showfps 1 | Display FPS counter |
Useful Binds
| Command | Description |
|---|---|
| bind "mwheeldown" "+jump" | Mouse wheel jump for bunny hopping |
| bind "n" "noclip" | Toggle noclip for practice |
Troubleshooting
If your autoexec is not loading, check these common issues: the file may be named autoexec.cfg.txt instead of autoexec.cfg, the file may be in the wrong directory, or your commands may have syntax errors. Open the CS2 console and look for error messages after startup.
If changes do not seem to apply, try adding host_writeconfig at the end of your autoexec to force CS2 to save the settings.