3

On a dedicated server for Source engine games, there are two "global" configuration files - server.cfg and autoexec.cfg. Are these files executed at different times? What sort of configurations should go in which file?

2 Answers 2

1

autoexec.cfg is automatically executed once when the server starts before a map loads

server.cfg is automatically executed each time a map loads, including map changes

There's also map specific configs that are named after the map. These are executed last.

You usually want to put all of your server configuration in server.cfg so that any setting changes, such as from a mapname.cfg file, are reset when the map changes. The autoexec.cfg is used for anything that should be done before a map loads, such as sv_pure settings.

Also, you can change which file is executed on map change using the servercfgfile cvar. This is handy if you want to have different modes on a server, or run multiple servers from the same installation.

3
  • Not true, see developer.valvesoftware.com/wiki/Server.cfg and developer.valvesoftware.com/wiki/Autoexec, they're executed at launch.
    – user56
    Commented Jul 20, 2010 at 7:33
  • Which part of my answer is not true? Autoexec.cfg executes once at launch and server.cfg, by default, executes on every map change. That's the way it works. Commented Jul 20, 2010 at 17:37
  • The part where you say that server.cfg, by default, executes on every map change. According to Valve, it doesn't.
    – user56
    Commented Mar 9, 2011 at 17:29
3

While it might work for servers, autoexec.cfg is meant for clients. server.cfg only works on the server-side, which is useful since it will only be run if you launch a server (eg a listen server) not when you just join one. autoexec.cfg will fire in both cases.

3
  • Will autoexec.cfg fire on mapchange, on joining a server, or only when initially launching the game?
    – Jeffrey
    Commented Jul 19, 2010 at 14:11
  • On launch only. Same goes for server.cfg, but only if run as a dedicated server.
    – user56
    Commented Jul 19, 2010 at 14:18
  • 1
    You can manually run autoexec.cfg using 'exec autoexec.cfg' in the Developer console.
    – cowgod
    Commented Jul 20, 2010 at 3:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .