Exec: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Console command}} | |||
<code>'''exec'''</code> is a [[console command]] available in all {{game name|src|name=Source}} games. | <code>'''exec'''</code> is a [[console command]] available in all {{game name|src|name=Source}} games. | ||
It is used to execute [[.cfg]] files, namely a sequence of console commands. | It is used to execute [[.cfg]] files, namely a sequence of console commands. |
Revision as of 07:41, 6 August 2023
Template:Console command
exec
is a console command available in all Template:Game name games.
It is used to execute .cfg files, namely a sequence of console commands.
Usage
exec <filename> [path id]
The command executes the file "//[path id]/cfg/<filename>"
if it exists. The default value of [path id]
is *
, resulting in the default path <game>/cfg/<filename>
.
- The
<filename>
argument is the name of the file either with or without the .cfg extension. A path can also be prefixed. If the<filename>
argument is given, the game always prints the lineExecing config: <filename>
in the console. If the file does not exist, the game also prints the lineexec: couldn't exec <filename>
. - The optional
[path id]
argument can be used to specify a different path to execute CFG files from. Its first character must be*
.
Template:ModernTip Template:ModernTip Template:ModernWarning
Examples
Command | Executed file |
---|---|
exec config
|
<game>/cfg/config.cfg
|
exec config.cfg
| |
exec config *
| |
exec config */maps
|
<game>/maps/cfg/config.cfg
|
exec folder/config
|
<game>/cfg/folder/config.cfg
|
exec folder/config */maps
|
<game>/maps/cfg/folder/config.cfg
|
Similar Commands
There are console commands that are identical to exec
, but with slight differences.
ConCommand | Availability | Description |
---|---|---|
execifexists
|
![]() ![]() ![]() ![]() ![]() ![]() |
There is no error message execifexists: couldn't exec <filename> in the console if the specified file does not exist.
|
execwithwhitelist
|
![]() |
All console commands in the specified CFG file are executed with whitelistcmd. Commands are ignored if they are not whitelisted in <game>/bspconvar_whitelist.txt .
|