What an autoexec file does and why you need one
An autoexec file is a text document that runs your personal settings automatically every time you launch Counter-Strike 2. Instead of typing console commands by hand each session, the autoexec loads your preferred sensitivity, crosshair, volume levels, and keybinds the moment the game starts. This saves time and ensures your setup stays consistent.
The file is named autoexec.cfg and lives in a specific folder on your computer. Counter-Strike 2 reads it during startup and executes every command inside. You create it once, then forget about it — your settings travel with you.
Key Takeaways
- An autoexec.cfg file is a plain text document that loads your custom settings automatically when Counter-Strike 2 starts.
- You create the file using Notepad or any text editor, type your commands, and save it with the exact name autoexec.cfg in your game config folder.
- The config folder location depends on your operating system: Windows users find it in a Steam subfolder, while Mac and Linux paths differ.
- After creating the file, launch the game and type status in the console to confirm the autoexec loaded without errors.
- Common commands to include are sensitivity, crosshair settings, volume, and keybinds — anything you would normally type into the console by hand.
Finding your config folder on Windows
Your config folder sits inside the Counter-Strike 2 game directory on your hard drive. The path is usually C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo\cfg if you installed Steam in the default location.
If Steam is installed elsewhere, navigate to wherever you put it, then follow the same subfolder path: steamapps → common → Counter-Strike Global Offensive → game → csgo → cfg. You should see existing files like gamestate_integration_example.cfg inside this folder. This is the correct location.
If you cannot find the folder, open Steam, right-click Counter-Strike 2 in your library, select Properties, then Local Files, then Browse. This opens the game folder directly. From there, navigate to game → csgo → cfg.
Creating the autoexec.cfg file
Open Notepad (or any plain text editor — not Word or Google Docs). Paste or type the commands you want to run. Here is a basic example to start with:
unbindall bind "w" "+forward" bind "a" "+moveleft" bind "s" "+back" bind "d" "+moveright" bind "space" "+jump" bind "ctrl" "+duck" sensitivity "1.8" volume "0.5" cl_crosshairsize "small" cl_crosshairthickness "1" cl_crosshairgap "-2"
You can add or remove commands depending on what you want to customize. Each command goes on its own line. Do not include the quotation marks unless the command itself requires them (like the examples above).
Once you have typed your commands, go to File → Save As. Name the file exactly autoexec.cfg — the name must be precise, including the .cfg extension. Set the file type to All Files (not Text Document). Navigate to the cfg folder you found earlier and save it there.
Finding your config folder on Mac and Linux
Mac users find the cfg folder at ~/Library/Application Support/Steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/cfg. The tilde (~) represents your home directory. You may need to show hidden files to see the Library folder — press Command+Shift+Period to toggle hidden files in Finder.
Linux users look in ~/.steam/steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/cfg. The hidden .steam folder may not appear by default in your file manager. Enable viewing hidden files in your file manager settings, or use the terminal command cd ~/.steam/steam/steamapps/common/Counter-Strike\ Global\ Offensive/game/csgo/cfg to navigate there directly.
Once you locate the cfg folder, create and save your autoexec.cfg file using the same method as Windows: open a text editor, type your commands, save as autoexec.cfg with file type set to All Files, and place it in the cfg folder.
Testing your autoexec file
Launch Counter-Strike 2 normally. Once you are in the main menu or in a game, open the console by pressing the backtick key (`) — the key to the left of the 1 on most keyboards. If the console does not appear, go to Settings → Game → Enable Developer Console and set it to Yes.
Type status in the console and press Enter. Look at the output. If your autoexec loaded, you will see no error messages. If something went wrong, the console will show a message like "Unknown command" or "couldn't exec autoexec.cfg" — this usually means the filename is misspelled or the file is in the wrong folder.
Test one of your custom settings to confirm it worked. For example, if you set sensitivity to 1.8, type sensitivity in the console and press Enter. It should display your value. If it shows a different number, the autoexec did not load.
Common commands to add to your autoexec
Sensitivity and mouse settings are the most important for aiming. Use sensitivity "1.8" (replace 1.8 with your preferred number) and m_yaw "0.022" to lock your vertical aiming speed. Volume goes in as volume "0.5" where 0.5 means 50 percent.
Crosshair customization uses commands like cl_crosshairsize "small", cl_crosshairthickness "1", cl_crosshairgap "-2", and cl_crosshaircolor "1" (0 through 4 for different colors). Keybinds follow the format bind "key" "command" — for example, bind "e" "+use" binds the E key to the use action.
You can also add unbindall at the top to clear all previous binds before setting your own, which prevents conflicts. Add host_writeconfig at the end to save your settings to the game's config file as a backup.
Troubleshooting when your autoexec does not load
The most common mistake is saving the file as autoexec.cfg.txt instead of autoexec.cfg. Windows hides file extensions by default, so you might not see the problem. To fix this, open File Explorer, go to View, and check the box for File name extensions. Then rename the file to remove the .txt at the end.
The second common issue is saving the file in the wrong folder. Double-check that autoexec.cfg is in the cfg subfolder, not in the csgo folder or the game folder above it. The full path should end with /cfg/autoexec.cfg.
If you see an error message in the console about a specific command, that command may not exist in Counter-Strike 2 or may have a different name. Remove or comment out that line (add // at the start) and try again. Check the Counter-Strike 2 console documentation or community forums for the correct command name.
Frequently Asked Questions
Can I edit my autoexec file after I create it?
Yes. Open the file in Notepad, make your changes, and save it. The next time you launch Counter-Strike 2, the new settings will load. You do not need to restart the game to edit the file — just close and reopen the game.
What if I want to use someone else's autoexec settings?
You can copy their commands into your own autoexec file. Paste the text into Notepad, save it as autoexec.cfg in your cfg folder, and launch the game. Their settings will load instead of yours. You can mix and match commands from different sources as long as they do not conflict.
Will using an autoexec file get me banned?
No. Autoexec files contain only console commands that you could type by hand. They are not cheats and do not modify game files or give you unfair advantages. Thousands of players use them.
Can I have multiple autoexec files for different situations?
Counter-Strike 2 only reads autoexec.cfg automatically. However, you can create other .cfg files with different names and load them manually by typing exec filename in the console. For example, create a file called practice.cfg and type exec practice to load it when you want.
What happens if my autoexec has a typo in a command?
Counter-Strike 2 will skip that line and show an error in the console, but the rest of your autoexec will still load. Check the console output for the line number of the error, open your autoexec file, find that line, and fix the typo. Save and relaunch the game.