There are some commands which can only be used in the Target box of your HL2 icon, or in the 'Launch Options' box of Steam. They cannot be used in the game's console or in your autoexec.cfg file. These are referred to as 'Command Line' commands, and the most useful of these commands are:
-heapsize [Kilobytes]: This command tells Half Life 2 to allocate more RAM to the game system heap, where it can be accessed by the game to improve performance by storing more game information in RAM and hence reducing loading pauses. The default heapsize is 64MB, however you can safely allocate around 128MB (i.e. -heapsize 128000) for most systems. You can use higher values if you have more RAM, but I don't recommend exceeding half your physical RAM (e.g. for 1GB RAM, set heapsize of 512000).
-console: Speeds up the loading of Half Life 2 at startup by not loading up the background 3D graphics on the main menu and instead loading up a blurry background picture and the Half Life 2 console open. Note you can close this console using the '~' key.
-width [pixels] -height [pixels]: Using these two commands you can set a custom resolution in Pixel Width x Pixel Height (e.g. -width 640 –height 480 starts HL2 with 640x480 resolution). Make sure you choose a resolution supported by your monitor and with the correct ratio of width to height (usually 4:3).
-dxlevel [version]: Using this command allows you to force Half Life into only using the specified DirectX version for shaders. For example, use -dxlevel 70 to force Hardware DirectX7.0 level support for shaders. This means a reduction in image quality but an increase in performance. Other values include -dxlevel 80 -dxlevel 81 and -dxlevel90. Note that this only works if you choose a DirectX version which is lower than the current one supported by your graphics card. See the Hardware DirectX Version option under the In-Game settings for more details.
-rate [Hz]: Specifies the refresh rate the game will use upon loading. This is normally not required as your system should already use the optimal refresh rate at your chosen resolution. However if this is not the case you can force it to a specific refresh rate (e.g. -rate 85). Make absolutely certain that the rate you are trying to apply does not exceed your monitor's capabilities otherwise you may damage your monitor - especially if you change resolutions and forget to change this option.
Notice that all of the command line commands above have a '-' in front of them. This only applies to these specific few command line commands. In general if you want to run any of the command variables listed on the next few pages in your icon's Target box, or in Launch Options, you must add a '+' sign in front of them (instead of a '-') before inserting them. For example, if you want to use the "exec" command to execute a config file at startup, you will actually have to put the command into the Target/Launch Options box in the following way:
-dxlevel 70 +exec mytweaks.cfg
In the example above, when you start Half Life 2 the DirectX Hardware support is reduced to DirectX7.0, and the contents of the file 'mytweaks.cfg' will be executed.
The simple rule for using commands in the command line is that aside from the few command line-specific commands listed further above, all other command variables, such as those listed on the following pages, require a '+' sign in front of them if used in the Target box or Steam's Launch Options. Note that you must also place a single space between each separate command, and no " " (quote) marks are required around the commands.