cfg

From Valve Developer Community
Revision as of 14:52, 2 May 2017 by Kidnation (talk | contribs) (Added .vtest link in see also, removed link from 'exec', removed the note about the cfg folder since I added that to the description, and changed the description a little bit.)
Jump to navigation Jump to search

Template:Otherlang2

.cfg files can be found everywhere and are not specific to Source. It is an abbreviation of configuration.

In Source games, a configuration file can be executed to perform a list of console commands. CFG files can be written in any other plain text editor. To create one, right-click the blank space in a cfg folder, and go to New>Text file. Rename it to myconfig.cfg or whatever you want, as long as it ends in .cfg and is placed in the cfg folder. You can then open it in your text editor and put commands in.

Normally, the file autoexec.cfg is run when the game starts up, so you can easily put any commands that you don't want to enter each time into that.

They can also be run from the console using "exec <cfgname>" where filename is the name of the configuration file, excluding its .cfg extension. Sometimes people put exec lines into the autoexec.cfg, so that other cfg files are executed when the game starts up. Configuration files can be placed in subdirectories of the cfg folder. The exec command would require you to include the subdirectories in the command.

See also

External links