Command Line
There are a range of commands - mainly designed for servers running BF2 - which can be activated via the BF2 command line. You can use these commands by going to your main Battlefield 2 shortcut you use to launch the game, right-click on it and select Properties. Note that in Windows Vista, you should open Games Explorer, right-click on the Battlefield 2 icon, select Customize, highlight the first 'Play' commend and select Edit. Then in the Target box, after the "C:\Program Files\EA Games\Battlefield 2\BF2.exe" text, insert another space, then use any of the commands below. Each command must have a single space between it and the next command.
For example, one of the most commonly requested commands is to run BF2 in a custom resolution - particularly for LCD displays which display the best image at their native resolution. To do this, change your command line to look like this:
"C:\Program Files\EA Games\Battlefield 2\BF2.exe" +menu 1 +fullscreen 1 +szx 1280 +szy 1024
Note the addition of the +szx and +szy commands which respectively set the width and height of the resolution to be used. Substitute other values for other resolutions (e.g. +szx 1900 +szy 1200). Also note that as of the 1.03 Patch, 1280x1024 is now a supported resolution and can be selected within the in-game settings, and as of the 1.50 Patch, widescreen resolutions are also supported, so you don't need to use the +szx/+szy commands to force these resolutions anymore.
The following are the known command line commands for BF2, and descriptions where possible:
+playerName - Set the player name
+playerPassword - Sets the player password
+joinServer - Join a server by IP address or hostname
+fullscreen - Start game in full screen mode
+nosound - Start game without sound
+szx - Set resolution width
+szy - Set resolution height
+dedicated - Start in dedicated server mode
+multi - Allow starting multiple BF2 instances
+password - Set the server password when joining a server
+config - Sets path to the ServerSettings.con file to use
+maplist - Sets the path to the MapList.con file to use
+lowPriority - Run the game with slightly lower priority
+loadLevel - Set the level to load
+wx - Position game window on the screen at certain x-position
+wy - Position game window on the screen at certain y-position
+demo - Sets the con-file with demo options
+maxPlayers - Sets max players
+gameMode - Sets the game mode
+modPath - Sets the mod path (default /mods/bf2)
+help - Displays help
+ranked - Allows GamSpy snapshot sending
+playNow - Use PlayNow functionality
+port - Specifies the network port to be used
+pbPath - Set the path to use for PunkBuster on multi-instance configs
+hostServer -
+checkForAvailablePatch -
+checkForPatch -
+ai -
+restart - skips intro movies
Note: You must use the correct case for these commands to work - for example the +playername command only works if used thusly: +playerName - note the capitalized N. These all work as of the latest version, including commands like +joinServer.
As you can see, most of these commands are really only useful for those running BF2 servers, and the descriptions are fairly vague. However a couple of the more useful commands are covered in more detail on the last page of this guide.