Command Line Options
Introduction
Battlefield 2 supports quite a few command line options. Most of you are probably already familiar with ones such as +fullscreen 1
. Incase some of you don't know, you can set a command line option by bringing up a shortcut's properties, going to the shorcut tab, and adding any of these options to the end of the 'Target' field. Command line options can only be set on shorcuts, which is useful because it allows you to have multiple shortcuts, all with different command line options. The following is a list of known command line options.
NOTE: The following options were found with the debug version of the BF2.exe, so some of these options may not work with the normal BF2.exe. The debug build can be obtained by downloading and installing the Battlefield 2 Editor. Once installed the debug build is named BF2_r.exe in your main Battlefield 2 directory. The Battlefield 2 Editor can be downloaded at Battlefield 2 Editor Also, case does matter when using these options.
Basic Options
+multi
- Description: Allows you to start multiple instances of Battlefield 2 at the same time.
Usage: +multi <bool>
+joinServer
- Description: Joins the specified server. Accepts either a server ip or a hostname.
Usage: +joinServer <string> OR <ip>
+playerName
- Description: Sets the player name.
Usage: +playerName <string>
+password
- Description: Used in conjunction with
+joinServer
when the server requires a password. Possibly also sets the password for a dedicated server?
Usage: +password <string>
+lowPriority
- Description: Runs Battlefield 2 with a lower process priority(less CPU intensive, lower performance)
Usage: +lowPriority <bool>
+loadLevel
- Description: Loads the specified level.
Usage: +loadLevel <string>
+wx
- Description: When Battlefield 2 is running in windowed mode, this sets the window's horizontal position on the screen. When setting this option, keep in mind that 0 corresponds to the left of the screen, and that the window is being positioned from its left side.
Usage: +wx <int>
+wy
- Description: When Battlefield 2 is running in windowed mode, this sets the window's vertical position on the screen. When setting this option, keep in mind that 0 corresponds to the top of the screen, and that the window is being positioned from its top side.
Usage: +wy <int>
+szx
- Description: When Battlefield 2 is running in windowed mode, this sets the window's horizontal size.
Usage: +szx <int>
+szy
- Description: When Battlefield 2 is running in windowed mode, this sets the window's vertical size.
Usage: +szy <int>
+loadObfuscated
- Description: Load obfuscated shaders. No idea what that means.
Usage: +loadObfuscated <bool>
+fullscreen
- Description: Toggles Battlefield 2 between windowed and full screen mode.
Usage: +fullscreen <bool>
+noSound
- Description: Starts Battlefield 2 with sound disabled.
Usage: +noSound <bool>
+lateLoading
- Description: If set to 1, then resources (only sound at the moment) will be loaded on first use.
Usage: +lateLoading <bool>
+skipMips
- Description: Sets how many mip-levels to skip in textures.
Usage: +skipMips <int>
+mergeMaterials
- Description: Concatenate materials at load time.
Usage: +mergeMaterials <bool>
+managedTextures
- Description: Decides whether system memory should be used for textures.
Usage: +managedTextures <bool>
+debugOutput
- Description: Enables or disables debug output.
Usage: +debugOutput <bool>
+demo
- Description: Sets the con-file with demo options. Not sure what this does.
Usage: +demo <??>
+pyVerbose
- Description: Display verbose Python script output. Nothing too interesting here.
Usage: +pyVerbose <bool>
+modPath
- Description: Sets Battlefield 2's mod path. This is normally
mods/bf2
.
Usage: +modPath <string>
+ignoreAsserts
- Description: Ignores debug assertion errors. This can only be used in conjunction with
+developer 1
or+dedicated 1
.
Usage: +ignoreAsserts <bool>
+disableShaderCache
- Description: Disables the shader cache. This should only be used in conjunction with
+developer 1
.
Usage: +disableShaderCache <bool>
+dumpAllConFiles
- Description: Writes the names of every
.con
file tomods/$MOD$/allConFiles.con
.
Usage: +dumpAllConFiles <bool>
+customConFile
- Description: Uses the specified
.con
file instead of loading all of the.con
files. This file should be used to specify which con files to run, using therun
command.
Usage: +customConFile <string>
+help
- Description: Displays command line option help, which lists all command line options and gives some descriptions.
Usage: +help
+?
- Description: Does the same thing as
+help
.
Usage: +?
+fileMonitor
- Description: Enables automatic update of changed files (shaders, etc). This could prove to be very useful if it applies to
.con
and.py
files.
Usage: +fileMonitor <bool>
+playerPassword
- Description: Sets the player's password
Usage: +playerPassword <string>
+developer
- Description: Does not auto-login, and also allows other command line options to be used in conjunction with it.
Usage: +developer <bool>
+disableSwiff
- Description: Disables swiff player. Basically this disables the flash that is used at the main menu area. Swiff refers to
.swf
, the flash file format.
Usage: +disableSwiff <bool>
+debugSwiff
- Description: Enables swiff debug output. Swiff refers to
.swf
, the flash file format.
Usage: +debugSwiff <bool>
+playNow
- Description: Starts up the game and automatically uses the 'Play Now' functionality.
Usage: +playNow <bool>
+pbPath
- Description: Sets the path to Punkbuster for multiple-instance configurations. This is normally
{install_dir}/pb
.
Usage: +pbPath <string>
+keepCollisionForNavMeshes
- Description: Keep collision mesh lods needed to generate AI navigation meshes. Not sure what this does.
Usage: +keepCollisionForNavMeshes <bool>
+restart
- Description: Used by BF2 to restart the game without showing video for example when mod switching - can also be used to start BF 2 without showing videos using your own shortcuts
Usage: +restart <bool>
+port
- Description: Used for specifying a port number to connect to in conjuntion with
+joinServer
Usage: +port <integer>
Dedicated Server Options
+dedicated
- Description: Starts Battlefield 2 in dedicated server mode. Not needed on Linux
Usage: +dedicated <bool>
+port
- Description: Specifies which port the server should use.
Usage: +port <int>
+maxPlayers
- Description: Sets max number of players for the server.
Usage: +maxPlayers <int>
+gameMode
- Description: Sets the gamemode for the server.
Usage: +gameMode <string>
+config
- Description: Sets the path to the ServerSettings.con file to use.
Usage: +config <string>
+mapList
- Description: Sets the path to the mapList.con file to use.
Usage: +mapList <string>
+noStatusMonitor
- Description: If you don't want to run bf2 inside screen you need to use this.
Usage: +noStatusMonitor <int>
with values 1 (or 0 the default if you don't specify this option at all)
+ranked
- Description: Allows gamespy snapshot sending. This setting will do nothing unless EA has the IP of the server in their database.
Usage: +ranked <bool>
Advanced Options
+hostServer
- Description: Unknown at the moment. Most likely starts a local server.
Usage: +hostServer <??>
+checkForAvailablePatch
- Description: Unknown at the moment. Most likely does what the name says. When used with the debug build, returns an error message on startup. Appears to be broken.
Usage: +checkForAvailablePatch <??>
+checkForPatch
- Description: Unknown at the moment. How does this differ from
+checkForAvailablePatch
? When used with the debug build, returns an error message on startup. Appears to be broken.
Usage: +checkForPatch <??>
+aidll
- Description: Unknown at the moment. Perhaps disables or enables the Battlefield 2 aidll.dll?
Usage: +aidll <??>
+ai
- Description: Used to Force BF2 to load AI BOTS! No matter the map, requirements, or settings. --MasterX
Usage: +ai <0/1>
+refresh
- Description: Unknown at the moment.
Usage: +refresh <??>
+renderMode
- Description: Sets the current render mode. Possible render modes are 0-5, not sure what each one does yet.
Usage: +renderMode <int>
+rp
- Description: Unknown at the moment.
Usage: +rp <??>
+deviceType
- Description: Unknown at the moment.
Usage: +deviceType <??>
+deviceBehavior
- Description: Unknown at the moment.
Usage: +deviceBehavior <??>
+skipMeshLods
- Description: Unknown at the moment. LoD
Usage: +skipMeshLods <??>
+keepTemplates
- Description: Unknown at the moment.
Usage: +keepTemplates <??>
+profileTextureUsage
- Description: Unknown at the moment.
Usage: +profileTextureUsage <??>
+convertCollisionMeshes
- Description: Unknown at the moment.
Usage: +convertCollisionMeshes <??>
+generateLightMaps
- Description: Unknown at the moment.
Usage: +generateLightMaps <??>
+debugNetwork
- Description: Unknown at the moment.
Usage: +debugNetwork <??>
+debugGhostManager
- Description: Unknown at the moment.
Usage: +debugGhostManager <??>
+compile
- Description: Unknown at the moment.
Usage: +compile <??>
+useCompiled
- Description: Unknown at the moment.
Usage: +useCompiled <??>
+NoEffectTextureAtlas
- Description: Unknown at the moment.
Usage: +NoEffectTextureAtlas <??>
+menu
- Description: Unknown at the moment. This is used by Battlefield 2's default shortcut as
+menu 1
.
Usage: +menu <bool>