Exec
Exec
<File Name>
This command is available in CS:GO and CS2, and you can use it for any game mode available. Because once again, its function is to execute script files, and it’s necessary in any type of game mode.
Name:
File Name
Description:
The name of the file, which is located in \Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg\ that you want to execute by default, you only need to mention the file name and not the .cfg extension.
EXTRA INFORMATION
Find additional information relating to this command below.
sv_cheats Required
Yes
Client or Server Command
Client

Guide on How to Use the exec Command in CS:GO & CS2

Did you know you can execute any script in CS:GO (CS2) via the developer console? By simply using the exec command, you can run any .cfg of your choice, simply by stating its name as the argument of the command.

Be it the CS GO exec file, or your custom script with all the commands you need for your private server, we are going to teach you all about this command.

We’ll start by bringing you a proper overview on what the exec command is and how it works, and then check a tutorial on how to use it, along with practical examples on how to input it via console.

Definition of the exec Command

As you can easily guess, it is a command that allows you to execute a script or .cfg file, located in the cfg folder. All it needs is the name of the file as an argument, and hence it will accept any type of alphanumeric argument be it short or long. 

Because its only function is to open and run scripts and .cfg files, there’s no need to activate sv_cheats 1 beforehand. You can use it immediately via launching the developer console, and only if the files are located in the cfg folder, otherwise the command won’t work.

This command is available in CS:GO and CS2, and you can use it for any game mode available. Because once again, its function is to execute script files, and it’s necessary in any type of game mode.

How Does the exec Command Work?

The exec command works by locating a script or .cfg file in the cfg folder and running it, only by using the name of such file as the argument. Instead of having to locate, open and run it manually, this command was introduced to simplify this task.

This is especially useful if you’re running your private server, and you want to bring your players a specific gameplay experience. By bringing you the power to run multiple scripts easily by inputting a simple command, you can save plenty of time and energy, making it easier to run your server.

Furthermore, since you can create different .cfg files with specific configurations, this command allows you to execute such files easily. Bringing you even more freedom and flexibility for fine tuning your gameplay experience, all with just a couple of clicks.

Now that it’s clear how this command works, let’s see how you can use it via console, to start executing all of your scripts in the cfg folder easily.

How to Use the exec Command

Now that you have a proper overview on the exec command and how it works, let’s see how you can start using it via console:

  1. Hit “~” to launch the console
  2. Input exec
  3. Write the name of the script you want to run as the argument
  4. Press “Enter”
  5. The script will execute automatically

For example, if you have created a script named “botsconfig.cfg”, and you want to run it, all you need to do is to use the command like this: exec botsconfig. Hit Enter, and the file will be executed automatically.

We will also take this as an opportunity to remind you how important it is to keep your scripts files organized, by properly naming them. Just like you need to do it for CS:GO demos, the same goes for the scripts you want to execute, as it’s going to make it easy to run the exec command.

Now that it’s all clear on how you need to use the exec command to execute any script you wish to, let’s check some practical examples to wrap it all together.

Examples on How to Use The exec Command

To make it even easier for you to understand how to implement this command in CS:GO and CS2, below you will find a list of different examples, showing exactly what you need to do to execute any script file of your choice.

Execute the CS GO Exec File

If you want to execute the CS GO exec file, which is just another name for the autoexec file, all you need to do is to use its name as the argument, resulting in the following: exec autoexec. Upon inputting it, press Enter and it will automatically execute all the commands and instructions inside it.

If you want to keep it easy, and you’re not planning to run complex configurations and multiple commands, you can put everything you need inside this file. 

However, if you are planning to create different configurations for specific purposes, we recommend you to create different script files. This is why we will visit a list of examples on how to execute .cfg files other than the classic autoexec.cfg.

Execute the custombots.cfg File

For example, if you have created a specific script to run bot commands, and let’s say you have named it as “custombots.cfg”, any time you want to execute it, all you need to do is to input the command like this: exec custombots. Press Enter and all the commands inside the file will be executed automatically.

This is a great idea to execute all the bot commands you need, especially for practice. Therefore, if you haven’t created it yet, we suggest you do it, and you can execute it by following the instructions of this section.

Execute the bunnyhop.cfg File

If you want to bunny hop in CS:GO and CS2, you need to run a specific list of commands, but doing it manually is tiring… especially if you have to do it every single time you launch the game. To save time and energy, you can create a script named “bunnyhop.cfg” and put all of your bunny hop commands in there.

Any time you want to launch it, all you need to do is to input the command like this: exec bunnyhop. Instantly, it will run all the necessary commands for everyone to bunny hop on your private server or match.

Execute the surfconfig.cfg File

If you want to surf in CS:GO and CS2, just like bunny hop, you also need to execute several commands, and doing it manually every time you want to activate this special effect can become pretty tiring. This is why it’s a better idea to create a dedicated script file for it, to put all the necessary commands inside it.

Therefore, after creating it, let’s suppose you name it “surfconfig.cfg”, then you’d need to input the command like this to execute this script: exec surfconfig. Automatically, it will run all the necessary commands for everyone in the game to surf without restrictions.

Execute the deathmatchconfig.cfg File

It’s also a good idea to create a script file for a specific game mode, like Death Match. In this case, you can create your own file and name it as “deathmatchconfig.cfg”, and every time you launch it by inputting “exec deathmatchconfig”, it will execute all the commands inside it.

Execute the armsraceconfig.cfg file

Just like you can create a specific .cfg file for Deathmatch, you can also do it for Arms Race, another popular game mode. For the purpose of this example, let’s name it “armsraceconfig”, and to run it, you’d only need to input the command like this: exec armsraceconfig. Automatically, it will execute all the commands inside it, allowing you to enjoy a bespoke Arms Race gameplay experience.

Execute the wingmanconfig.cfg File

Wingman is another popular game mode in CS:GO and CS2, and if you would like to fine tune its settings, it’s a good idea to create a script file dedicated to it, containing all the commands you want to run. In this case, we can name the file as “wingmanconfig.cfg”, and any time you want to execute it, you can do it by inputting the command like this: exec wingmanconfig.

All the commands inside the script file will be executed instantly upon inputting the exec command, allowing you to enjoy the exact type of Wingman gameplay experience you want.

With all of these examples, it should be clear how you need to use the exec command to execute any script and .cfg file of your choice.

F.A.Q

If you’d like to explore extra details and information about the exec command in CS:GO and CS2, below you will find the answers to the most frequently asked questions about it.

How can I open .cfg files via console in CS:GO?

If you want to execute .cfg files directly via console in CS:GO, all you need to do is to use the exec command along with the name of the script you want to open as the argument. For example, if you want to run a script titled “newwarmup.cfg”, you’d need to use the command like this: exec newwarmup. Press “Enter” and the script will run automatically. 

Is it possible to disable the exec command?

No, it is not possible to disable the exe command in CS:GO or CS2. If you don’t want to deal with it, simply don’t use it, as it’s not strictly necessary to execute this command to play the game. It’s only a must if you want to execute script files directly via console.

How to run exec CS:GO?

To run exec CS:GO, which usually refers to the autoexec file, you need to use the exec command like this: exec autoexec. Then, just hit “Enter”, and it will run exec CS:GO automatically, with all of your scripts and commands inside the file.

Can I execute any type of script with the exec command?

Yes. you can use the exec command to open and run any type of script, as long as it’s a valid .cfg file. Simply use the name of the script you want to execute as the argument of the command, input it via console, hit Enter, and it will run automatically.

Is the exec command available in CS2?

Yes, the exec command is available in CS2, just like in CS:GO. You can input it via console to open and run any sort of script, simply by using the name of the script as the argument of the command.